Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

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 have set up (actually migrated) wordpress on ubuntu 10.04 with apache2 and everything works great. However, I'm getting the following error when using a plugin to upload files to the server:

[Wed Jun 06 13:12:29 2012] [error] [client] PHP Warning: fopen(/home/user/public/ failed to open stream: Permission denied in /home/user/public/ on line 164, referer:

I've taken a bit too much on I think. I'm not a developer at all, but I thought it would be fun to try and set myself up with a Linode VPS.

I suspect that there is some sort of permissions problem. www-data is my php user. Could it be that www-data is lacking permissions? And how do I go about troubleshooting this?

Any help is greatly appreciated.

share|improve this question
up vote 2 down vote accepted

Give 755 permissions to the /home/user/public/ folder, subfolders and all files.

share|improve this answer
I thought I had. Is there a command that I can use to check this? – Rob Jun 6 '12 at 14:27
I typed this just now: sudo chmod -R 755 /home/user/public/ Of course changing user and with my own. Still getting error. – Rob Jun 6 '12 at 14:32
Reapply with sudo chmod -R 755 /home/user/public/ – jasmines Jun 6 '12 at 14:34
Thanks jasmines. I'm not sure what you mean "Reapply"? Shouldn't typing the command once be sufficient? Please be patient with me because I'm new to linux. – Rob Jun 6 '12 at 14:48
Yes, type it in a terminal. – jasmines Jun 6 '12 at 14:50

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.