I can't open files on my server

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Azmerod
Forum Newbie
Posts: 5
Joined: Mon Oct 14, 2002 5:41 pm
Contact:

I can't open files on my server

Post by Azmerod »

Here are the errors i get when i try to do a simple fopen. How do I get around this?


Warning: fopen("somefile.txt", "w") - Permission denied in /home3/sgdevel/public_html/screenshots/test.php on line 2

Warning: fclose(): supplied argument is not a valid File-Handle resource in /home3/sgdevel/public_html/screenshots/test.php on line 3

And here's the code I'm using

Code: Select all

<?php
$fp = fopen("somefile.txt", "w"); 
fclose($fp); 
?>
Simple enough but it doesn't seem to work. Any suggestions?
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

a search on "permission AND denied" revealed i.e. viewtopic.php?t=2821&highlight=permission+denied

and: welcome Image
Azmerod
Forum Newbie
Posts: 5
Joined: Mon Oct 14, 2002 5:41 pm
Contact:

Post by Azmerod »

haha! It works. You guys are awesome. Thanks for your help
Post Reply