PHP cannot write to filesystem

Support for webhosts that use CentOS
Post Reply
Posts: 1
Joined: 2005/11/19 05:00:17

PHP cannot write to filesystem

Post by marqrdt » 2006/06/19 12:09:05

Hi all,
I'm running a PHP application, and I cannot get it to write to the filesystem AT ALL, even if I change the permissions to 777 on all of the web files/directories and chown them to apache:apache. Has anybody experienced this sort of problem? Is there some sort of setting in php.ini or some system-wide setting that I can change? Thanks for any help on this matter.


Posts: 34
Joined: 2006/07/05 18:51:49

Re: PHP cannot write to filesystem

Post by danstoner » 2006/07/05 19:53:47

Is SELinux enabled?

If I am not mistaken, SELinux will prevent apache/php from writing files. This is to prevent a hacked web server from being able to do anything to the rest of the system.

To confirm, you can set SELinux so it only warns, not blocks. Change the value to "permissive" in /etc/selinux/config

You might need to reboot for the changes to take affect.

Once you figure out that this is your problem, it would be better to figure out how to modify the SELinux policy so you can leave it at "enforcing".

Post Reply

Return to “CentOS 4 - Webhosting Support”