Question
Can't write/delete files using nginx + php5-fpm (nginx is www-data, same as folder with files)
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
×
I am having the same problem. no matter what I do NGINX/PHP-FPM cant write to the folders. Did you figure this out??
nginx:
[root@instance-1 php-fpm.d]# ps aux|grep nginx|grep -v grep
nginx 21916 0.1 0.2 416884 22652 ? S 19:00 0:01 php-fpm: pool www
nginx 21917 0.1 0.2 416884 22604 ? S 19:00 0:01 php-fpm: pool www
nginx 21918 0.1 0.6 445956 51532 ? S 19:00 0:01 php-fpm: pool www
nginx 21919 0.1 0.7 450664 55956 ? S 19:00 0:01 php-fpm: pool www
nginx 21920 0.1 0.7 450352 56100 ? S 19:00 0:01 php-fpm: pool www
nginx 21948 0.1 0.6 431972 46848 ? S 19:00 0:01 php-fpm: pool www
nginx 22079 0.0 0.4 415760 31640 ? S 19:05 0:00 php-fpm: pool www
root 22463 0.0 0.0 47644 1248 ? Ss 19:12 0:00 nginx: master process /usr/sbin/nginx -c /etc/nginx/nginx.conf
nginx 22464 0.0 0.0 48080 2296 ? S 19:12 0:00 nginx: worker process
nginx 22465 0.0 0.0 48080 2056 ? S 19:12 0:00 nginx: worker process
nginx 22466 0.0 0.0 48080 2056 ? S 19:12 0:00 nginx: worker process
nginx 22467 0.0 0.0 48080 2056 ? S 19:12 0:00 nginx: worker process
php-fpm:
[root@instance-1 php-fpm.d]# ps aux|grep php|grep -v grep
root 21914 0.0 0.1 393788 12436 ? Ss 19:00 0:00 php-fpm: master process (/etc/php-fpm.conf)
nginx 21916 0.1 0.2 416884 22652 ? S 19:00 0:01 php-fpm: pool www
nginx 21917 0.1 0.2 416884 22604 ? S 19:00 0:01 php-fpm: pool www
nginx 21918 0.1 0.6 445956 51532 ? S 19:00 0:01 php-fpm: pool www
nginx 21919 0.1 0.7 450664 55956 ? S 19:00 0:01 php-fpm: pool www
nginx 21920 0.1 0.7 450352 56100 ? S 19:00 0:01 php-fpm: pool www
nginx 21948 0.1 0.6 431972 46848 ? S 19:00 0:01 php-fpm: pool www
nginx 22079 0.0 0.4 415760 31640 ? S 19:05 0:00 php-fpm: pool www
root dir:
drwxr-xr-x. 6 nginx nginx 4.0K Jul 24 03:53 public_html
www.conf:
; Start a new pool named ‘www’.
[www]
listen = /var/run/php-fpm/php-fpm.sock
listen.allowedclients = 127.0.0.1
listen.owner = nginx
listen.group = nginx
listen.mode = 0666
user = nginx
group = nginx
pm = dynamic
pm.maxchildren = 50
pm.startservers = 5
pm.minspareservers = 5
pm.maxspareservers = 35
slowlog = /var/log/php-fpm/www-slow.log
phpadminvalue[errorlog] = /var/log/php-fpm/www-error.log
phpadminflag[logerrors] = on
phpvalue[session.savehandler] = files
phpvalue[session.save_path] = /var/lib/php/session