[07-Dec-2015 17:07:08] NOTICE: [pool www] 'user' directive is ignored when FPM is not running as root[07-Dec-2015 17:07:08] NOTICE: [pool www] 'group' directive is ignored when FPM is not running as root
查看php-fpm
日誌發現以上提示,嘗試將php-fpm
的user
和group
修改成目前使用者所匹配的,錯誤依舊。
通過lsof -Pni4 | grep LISTEN | grep php
看到php-fpm
確實是以目前使用者而非root使用者運行。
php-fpm 51546 joshua 7u IPv4 0xef21d7f98be9663 0t0 TCP 127.0.0.1:9056 (LISTEN)php-fpm 51551 joshua 0u IPv4 0xef21d7f98be9663 0t0 TCP 127.0.0.1:9056 (LISTEN)php-fpm 51552 joshua 0u IPv4 0xef21d7f98be9663 0t0 TCP 127.0.0.1:9056 (LISTEN)php-fpm 51553 joshua 0u IPv4 0xef21d7f98be9663 0t0 TCP 127.0.0.1:9056 (LISTEN)
回複內容:
[07-Dec-2015 17:07:08] NOTICE: [pool www] 'user' directive is ignored when FPM is not running as root[07-Dec-2015 17:07:08] NOTICE: [pool www] 'group' directive is ignored when FPM is not running as root
查看php-fpm
日誌發現以上提示,嘗試將php-fpm
的user
和group
修改成目前使用者所匹配的,錯誤依舊。
通過lsof -Pni4 | grep LISTEN | grep php
看到php-fpm
確實是以目前使用者而非root使用者運行。
php-fpm 51546 joshua 7u IPv4 0xef21d7f98be9663 0t0 TCP 127.0.0.1:9056 (LISTEN)php-fpm 51551 joshua 0u IPv4 0xef21d7f98be9663 0t0 TCP 127.0.0.1:9056 (LISTEN)php-fpm 51552 joshua 0u IPv4 0xef21d7f98be9663 0t0 TCP 127.0.0.1:9056 (LISTEN)php-fpm 51553 joshua 0u IPv4 0xef21d7f98be9663 0t0 TCP 127.0.0.1:9056 (LISTEN)
改fpm配置讓fpm以你想要使用者運行,
sudo vim /etc/php-fpm.d/www.conf
; Set permissions for unix socket, if one is used. In Linux, read/write; permissions must be set in order to allow connections from a web server. Many; BSD-derived systems allow connections regardless of permissions.; Default Values: user and group are set as the running user; mode is set to 0660;listen.owner = nobody;listen.group = nobody;listen.mode = 0660; Unix user/group of processes; Note: The user is mandatory. If the group is not set, the default user's group; will be used.; RPM: apache Choosed to be able to access some dir as httpduser = apache; RPM: Keep a group allowed to write in log dir.group = apache