nginx和php-fpm的用戶權限

  1. 啓動php-fpm
    sudo php-fpm -c /etc/php.ini
    [17-Sep-2018 00:36:59] ERROR: [pool www] please specify user and group other than root
    [17-Sep-2018 00:36:59] ERROR: FPM initialization failed

開始的時候,使用本機wyc用戶名及group名staff,發現session寫到了/var/tmp/下面,wyc帳戶沒有權限寫,切換到root帳戶,
php

切換到root帳戶,及wheel組
nginx

php-fpm啓動項裏有-c能夠容許用root啓動
-R, --allow-to-run-as-root
Allow pool to run as root (disabled by default)session

2.切換Nginx的帳戶,默認nobody,切換成root帳戶,user root 會報錯
➜ conf sudo /usr/local/openresty/nginx/sbin/nginx -s reload
nginx: [emerg] getgrnam("root") failed in /usr/local/openresty/nginx/conf/nginx.conf:3php-fpm

必須加上wheel組名就行了rest

相關文章
相關標籤/搜索