Unable to create directory wp-content/uploads/2013/04. Is its parent directory writable by the server?

April 21, 2013
HeartedHeart
6.8k views
does anyone have any idea how to solve it . i am running arch with nignx.
8 Answers
euantorano
HeartedHeart
Which user is nginx running under? Which group owns wp-content/uploads? What are the chmod permissions on wp-content/uploads?
studio
HeartedHeart
not nginx expert but i think same as apache www-data
chmod your directory and you should be fine
JustGiveMeTheDamnManual
HeartedHeart
I'm by far from an expert but this worked for me

chgrp nginx /var/www/wordpress/wp-content
sudo chown nginx /var/www/wordpress/wp-content
JustGiveMeTheDamnManual
HeartedHeart
Also use this command to find out what user owns the nginx worker processes

ps -elf | grep nginx

In my above comment "nginx" was the name of the user who owned the process.
jb5531
HeartedHeart
Hmm... this isn't working for me for some reason. Here is what I get with ps -elf | grep nginx:
$ ps -elf | grep nginx
55:1 S root 700 1 0 80 0 - 1501 rt_sig 20:24 ? 00:00:00 nginx: master process /usr/sbin/nginx -c /etc/nginx/nginx.conf
56:5 S www-data 702 700 0 80 0 - 1659 ep_pol 20:24 ? 00:00:00 nginx: worker process
72:0 S vagrant 874 32356 0 80 0 - 1156 pipe_w 20:33 pts/0 00:00:00 grep --color=auto -in nginx

I've tried everything - changing permissions and ownership so I can upload plugins and images to my WordPress install. I'm really not understanding why it's not working. Really frustrating!

kamaln7
HeartedHeart
@Jason: Try running
sudo chmod -R g+w /var/www/wordpress/wp-content

sudo chgrp www-data /var/www/wordpress/wp-content
  • iarroyo

    I think that second command should be recursive:

    sudo chgrp -R www-data /var/www/wordpress/wp-content
    

    or use:

    sudo chown -R :www-data  /var/www/wordpress/wp-content
    
    HeartedHeart
prasad0889
HeartedHeart
Hi,

System : I have centos 6 with nginx. I have installed ghost and wordpress on the server.

I have tried the above methods but it doesnt help.
I have restarted nginx, mysql, php-fpm and also rebooted the server, but it still shows me the error "Cant create directory".


Please help me.
kamaln7
HeartedHeart
@prasad0889: What's the output of
sudo ps wwaux | grep php
?