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

April 21, 2013 7k views
does anyone have any idea how to solve it . i am running arch with nignx.
8 Answers
Which user is nginx running under? Which group owns wp-content/uploads? What are the chmod permissions on wp-content/uploads?
not nginx expert but i think same as apache www-data
chmod your directory and you should be fine
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
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.
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!

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

sudo chgrp www-data /var/www/wordpress/wp-content
  • 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
    
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.
@prasad0889: What's the output of
sudo ps wwaux | grep php
?
Have another answer? Share your knowledge.