cannot create file

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
316
Forum Newbie
Posts: 2
Joined: Fri Mar 07, 2008 6:06 am

cannot create file

Post by 316 »

I am trying to create a file using php, but it fails, cannot create a file. NEED HELP. the code i am using is shown below.

$handle = fopen("/home/file.txt", "a");
fwrite($handle, "hello");
fclose ($handle);

Is it something to do with permission, or is it php , or is it apache serve??

How can i fix this problem??

I am using linux.

Thank in advcanced
User avatar
Zoxive
Forum Regular
Posts: 974
Joined: Fri Apr 01, 2005 4:37 pm
Location: Bay City, Michigan

Re: cannot create file

Post by Zoxive »

Most likely permissions, turn on error reporting and you will be getting errors explaining why you are unable to do so.
Post Reply