When I go to upload a file to my WordPress site, I get the following error:
Unable to create directory wp-content/uploads/2017/03. Is its parent directory writable by the server?
I am running WordPress on an Apache 2.2.2 server, on a Linux machine. The wp-content folder has 775 permissions, and I created a /uploads
folder inside also with 775 permissions. The user and group for both of these folders, and for the entire WordPress file directory, is www-data
.
I am running WordPress 4.7.3.
If this is noteworthy, upon installation, my upload_path
variable was not set. I have since set it to wp-content/uploads
and manually created the uploads
directory with 775 permissions.
The process of installation was to install using wget wordpress.org/latest.tar.gz
and install it from there.
Could this have something to do with it?
No solutions found on the net involving changing permissions, or setting php to unsafe mode, have worked.
Cheers!
EDIT:
Might other files and directories not being owned and grouped by www-data have anything to do with this? ls -l
makes this:
-rw-r--r-- 1 nobody nogroup 418 Sep 24 2013 index.php
-rw-r--r-- 1 nobody nogroup 19935 Jan 2 12:51 license.txt
-rw-r--r-- 1 nobody nogroup 7433 Jan 11 11:46 readme.html
-rw-r--r-- 1 nobody nogroup 5447 Sep 27 16:36 wp-activate.php
drwxr-xr-x 9 nobody nogroup 4096 Mar 6 10:00 wp-admin
-rw-r--r-- 1 nobody nogroup 364 Dec 19 2015 wp-blog-header.php
-rw-r--r-- 1 nobody nogroup 1627 Aug 29 2016 wp-comments-post.php
-rw-r--r-- 1 root root 3045 Mar 22 21:47 wp-config.php
-rw-r--r-- 1 nobody nogroup 2853 Dec 16 2015 wp-config-sample.php
drwxrwxr-x 5 www-data www-data 4096 Mar 22 23:09 wp-content
-rw-r--r-- 1 nobody nogroup 3286 May 24 2015 wp-cron.php
drwxr-xr-x 18 nobody nogroup 12288 Mar 6 10:00 wp-includes
-rw-r--r-- 1 nobody nogroup 2422 Nov 20 20:46 wp-links-opml.php
-rw-r--r-- 1 nobody nogroup 3301 Oct 24 22:15 wp-load.php
-rw-r--r-- 1 nobody nogroup 33939 Nov 20 20:46 wp-login.php
-rw-r--r-- 1 nobody nogroup 8048 Jan 10 23:15 wp-mail.php
-rw-r--r-- 1 nobody nogroup 16250 Nov 28 23:39 wp-settings.php
-rw-r--r-- 1 nobody nogroup 29896 Oct 18 23:47 wp-signup.php
-rw-r--r-- 1 nobody nogroup 4513 Oct 14 14:39 wp-trackback.php
-rw-r--r-- 1 nobody nogroup 3065 Aug 31 2016 xmlrpc.php
sudo -u www-data mkdir -p /var/www/wp-content/uploads/2017/03
command, I am allowed to make that directory. I am struggling to interpret what the output ofdmesg
means. – Avocado Surprise Mar 23 '17 at 04:54
– Avocado Surprise Mar 23 '17 at 04:56The uploaded file could not be moved to wp-content/uploads/2017/03.