Alex Rivera | Logout

Apache permissions, PHP file create, MKDir fail

Asked 2011-03-02T08:43:49.980
25

It seems i cannot create files. When i set permissions to 777 On the folder i am trying to create a folder in then the script works fine. If the folder is set to 755, it fails. I do not know much about linux, but i am suppose to figure this stuff out. I have spent a couple hours trying stuff. Does anyone know how to make it so that apache has high enough permissions.



I know it is a permissions and apache problem, i just do not know how to fix this. I have edited the httpd.conf file, but i really do not know what i am doing... Any help? (I saved backup.)

Edit
Report

1 Answer

19

I have a similar problem but in my case I have SELinux running and it failed even with 0777 permission. Turns out I need to explicitly allow httpd to have write access on the directory using:

chcon -R -t httpd_sys_rw_content_t <PARENT_OF_MKDIR_TARGET>

SELinux Troubleshooter may have more details.

answered 2013-05-08T17:19:00.057

Your Answer