Take the 2-minute tour ×
The uploaded file could not be moved to /var/www/wp-uploads/localhost/2011/10.

That's the error message I get when I try to upload a wordpress theme. This is my current permission status of my folder.

$ sudo ls -la /var/www/wp-uploads/localhost
total 12
drwxrwxr-- 3 root     www-data 4096 2011-10-27 16:44 .
drwxr-x--- 3 root     www-data 4096 2011-10-27 15:45 ..
drwxrwxr-- 3 www-data www-data 4096 2011-10-27 16:44 2011

Is there a terminal command I can use to allow wordpress to have permission to write things in this folder?

I use LAMP and Ubuntu 11.04.

Thank you.

share|improve this question
This is a user question, and would be better-asked in the WPORG How-To and Troubleshooting Forum. –  Chip Bennett Oct 27 '11 at 22:19
@Chip Bennett I disagree, this seems perfectly appropriate. –  Rarst Oct 30 '11 at 20:21
@Rarst really? A file-permissions question? –  Chip Bennett Oct 30 '11 at 20:24
@Chip Bennett how do you know it's permissions before question is resolved? WP outputs this error of its own and suppresses possible underlying PHP errors, this very well qualifies as issue that at least starts in WordPress and is specific as such. –  Rarst Oct 30 '11 at 20:36
add comment

1 Answer

up vote 0 down vote accepted

From quick search of source for this error message, it is likely to be triggered by failed move_uploaded_file() function call, which is native PHP and not WordPress.

Documentation says that it has some restrictions, related to safe_mode and open_basedir so that might be your issue.

Since WP suppresses error output from this function with @ directive I'd try to emulate such file move or un-suppress error (as far as I know this is not possible natively, but possible with xdebug and possibly other debuggers).

share|improve this answer
add comment

Your Answer


