Apache2 and Wordpress

Hey guys, I'm having a little trouble setting up Wordpress. I have virtualmin installed as well. When trying to update wordpress or add themes/plugins, I receive "The uploaded file could not be moved to xxx/xxx/xxx/wp-content/uploads" . I checked on google and wordpress forum and couldn't find an answer. I've been told that this is a server setup issue with Apache not having the correct permissions to the website directory.

Is anyone familiar with this issue?

Thanks.

5 Replies

Probably not the best way to do it, but I chown'd public_html and everything below it to www-data:www-data (which is Apache on my Debian install).

Thanks for the help.

I'm also on Debian, 5 32-bit. I tried your solution and it still gives the same error. I'm thinking it has something to do with the way virtualmin configures each new website, which i'm really unfamiliar with.

Not sure how Virtualmin configures users and permissions, but there's an easy way to find out.

Create a file with the following content, and name it whoami.php

Place it in your Wordpress public_html directory, and browse to it. It'll display the name of the user who is running the script. DELETE THE FILE IMMEDIATELY, AS IT MAY BECOME A SECURITY PROBLEM IF SOMEONE ELSE SEES IT.

Then you can chown the Wordpress files so that the said user can modify them.

If this doesn't work, check if you have safe_mode enabled or disabled in your PHP configuration.

BTW, I don't think it's a good idea to chown the entire public_html directory. Most of the time, Wordpress only needs to write inside the wp-content directory. The only exception is when Wordpress wants to update itself, or when a plugin wants to modify the .htaccess file. Those cases don't happen very often, so you should normally keep those files from being writable.

@hybinet Thanks for your help. I ran the script and the user running the script currently owns the entire public_html directory and all the files under it. I checked and php safe mode is turned off.

I tried uploading a plugin, about 650k in size and it worked, however i tried uploading a theme, which is 2.2 megs and it I receive the error message? My max file upload in php.ini is 8M so I don't think that's the issue. It's really odd, it seems like wordpress is timing out, anywho, I will try to increase the timeout value and see if that helps.

Thanks again.

Please disregard the last post, the issue is resolved. I restarted apache and it started working

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct