Sep 16
Wordpress Ownership Fix
I was recently getting a “Unable to create directory /var/www/wp-content/uploads/ Is its parent directory writable by the server?” And for the life of me I couldn’t figure out how to upload images to my upload folder. So my blog was lacking visuals for quite some time. Luckily I was just searching around and I came across a wordpress forum where people were having the same problem as I. Only one of the suggestions worked. And I must thank Sergee for the help! In fact I’m just going to quote Sergee and make it easy on myself. Sergee – “If you tryed everything and upload in your wordpress still doesn’t work – i have an answer for you. In short: php safe mode won’t let you create files or directories if your php scripts and upload directory belongs to different users. So there are 2 possible solutions: either disable php safemode (not recommended), or change an owner of scripts and upload directory:”
cd blog_root
chown -R apache:apache *
However the code above didn’t work for me exactly. This is because on my server there is no apache user or group. Apache runs under www-data user. So same concept but slightly different syntax.
sudo chown -R www-data:www-data /path_to_wordpress/wp-content/uploads
Yay that means that your uploads folder is now writeable by your server!

No Comments
Leave a comment