Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question
    
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 Sep 1 '11 at 16:02
    
ok i've done... – Dardan Vrabie Sep 1 '11 at 16:08

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.

share|improve this answer

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.

share|improve this answer

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!

share|improve this answer

You must log in to answer this question.

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