Page 1 of 1

cannot create file

Posted: Fri Mar 07, 2008 6:29 am
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

Re: cannot create file

Posted: Fri Mar 07, 2008 8:28 am
by Zoxive
Most likely permissions, turn on error reporting and you will be getting errors explaining why you are unable to do so.