WordPress can’t upload media saying “no permission”

I just setup a wordpress + nginx, but when I start to write my first blog, there comes a trouble. In admin page, I try to add a picture into media library, it complains “can’t create wp-content/uploads/2015/05, permission denied”.

Although I search the internet, most of guys are pointing to change ownershipt of “wp-contents/uploads” to be as php-fpm. But yes, I have checked the permission of uploads and also the running user of php-fpm. The worker php-fpm is running under “nginx” user, and namei for uploads:

Read More
drwxr-xr-x root root /
drwxr-xr-x root root var
drwxr-xr-x root root blog
drwxrwxrwx nginx nginx wp-content
drwxrwxrwx nginx nginx uploads

Then I use auditctl to check the activity on this “uploads” folder and see :

============================

type=PATH msg=audit(05/08/2015 14:07:00.247:1913) : item=1 name=/var/blog/wp-content/uploads/2015 objtype=CREATE
type=PATH msg=audit(05/08/2015 14:07:00.247:1913) : item=0 name=/var/blog/wp-content/uploads/ inode=266 dev=fd:01 mode=dir,777 ouid=nginx ogid=nginx rdev=00:00 obj=unconfined_u:object_r:usr_t:s0 objtype=PARENT
type=CWD msg=audit(05/08/2015 14:07:00.247:1913) : cwd=/var/blog/wp-admin
type=SYSCALL msg=audit(05/08/2015 14:07:00.247:1913) : arch=x86_64 syscall=mkdir success=no exit=-13(Permission denied) a0=0x7fff691d28c0 a1=0777 a2=0x8 a3=0x6e65746e6f632d70 items=2 ppid=13235 pid=13239 auid=unset uid=nginx gid=nginx euid=nginx suid=nginx
fsuid=nginx egid=nginx sgid=nginx fsgid=nginx tty=(none) ses=unset comm=php-fpm exe=/usr/sbin/php-fpm subj=system_u:system_r:httpd_t:s0 key=(null)

=====================

So, what is the wrong?

Thanks

Related posts