faqts : Computers : Programming : Languages : PHP : Common Problems : Files

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

0 of 10 people (0%) answered Yes
Recently 0 of 10 people (0%) answered Yes

Entry

I get 'Permission Denied' when I fopen a new file for writing, despite 777 access! Apache settings?

Mar 3rd, 2006 05:59
Harry Wood,


I'm trying a simple file writing test:
$file = "./test.txt";
$fp = fopen ("$file", "wb");
$content = "Hello, I am a File!";
fwrite($fp, $content);
fclose($fp);
The gives the permission denied error on 'fopen' line. I've done chmod
777  on the directory in which the test php script is sitting. I've also
tried swapping in a full path rather than './'  No joy.
This is fresh apache installation on linux. Is there something in
httpd.conf to enable file writing?