PHP fopen fails - does not have permission to open file in write mode.

Posted by George on Server Fault See other posts from Server Fault or by George
Published on 2011-01-30T18:35:26Z Indexed on 2011/01/30 23:27 UTC
Read the original article Hit count: 240

Filed under:
|
|
|

Hello. I have an Apache 2.17 server running on a Fedora 13. I want to be able to create a file in a directory.

I cannot do that. Whenever I try to open a file with php for writing fopen(,'w'), it tells me that I don't have permission to do that.

So i checked the httpd.conf file in /etc/httpd/conf/. It says user apache, group apache. So I changed ownership (chown -R apache:apache .*) of my whole /www directory to apache:apache. I also run chmod -R 777 *

Apart from knowing how terribly dangerous this is, it actually still gives me the same error, even though I even allow public write!

© Server Fault or respective owner

Related posts about apache

Related posts about php