1

I can't understand where the problem is. Apache is running with my standard user that actually can write those files.

What should I do?

2
  • It would be nice if you could post the commands and the errors you get as an actual text, and maybe tell us a bit about what you're trying to do.
    – slhck
    Commented Sep 1, 2011 at 16:02
  • ok i've done... Commented Sep 1, 2011 at 16:08

3 Answers 3

0

One possibility is that you have SELinux enabled and the files/directories that can't be written were originally created in your home directory (e.g. you unzipped them there, then moved then to /var/www/html). SELinux doesn't allow apache to modify those files even though they seem to have correct file permissions. Try disabling SELinux. If that resolves the problem, you can either run with SELinux permanently disabled, or you can work through the SELinux settings to get those files and directories writable by apache.

0

Check SElinux is enabled or not using the following command from su in console.

selinuxenabled && echo enabled || echo disabled

if it returns "enabled" then disable it using following command

echo 0 > /selinux/enforce

now check that apache can write to the user directory.

0

I don't like the idea of disabling SELinux.. rather enable SELinux so Apache/PHP can write to where you neeed it to.

You can simply change the SE context of the directory to allow httpd to upload file:

chcon -t tmp_t www/

I had to do the same thing to get Wordpress Media uploads to work on my upload/ folder. See my SU post @ Wordpress can't upload images due to permissions

Hope this helps!

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .