5fcc3e64721598624.jpg_fo742.jpg


修改/usr/local/php/etc/php-fpm.conf配置文件

user = www
group = www

改为:

user = root
group = root

重启

[root@nginx]# service  php-fpm restart
Gracefully shutting down php-fpm . done
Starting php-fpm [06-Oct-2020 09:10:34] ERROR: [pool www] please specify user and group other than root
[06-Oct-2020 09:10:34] ERROR: FPM initialization failed
 failed

运行 php-fpm -h 可以看到

-R, –allow-to-run-as-root

可见,启动时加参数 -R 即可
修改/etc/init.d/php-fpm
加上R参数:

case "1" in
        start)
                echo -n "Starting php-fpm "php_fpm_BIN --daemonize -R php_opts

                if [ "?" != 0 ] ; then
                        echo " failed"
                        exit 1
                fi

                wait_for_pid created php_fpm_PID

                if [ -n "try" ] ; then
                        echo " failed"
                        exit 1
                else
                        echo " done"
                fi
        ;;

发表评论

您的电子邮箱地址不会被公开。 必填项已用*标注

Captcha Code