mac重启php-fpm失败

关闭

killall -HUP php-fpm

重启,这里报错,提示找不到文件

yokedeMacBook-Pro999:7.0 jx$ php-fpm 
[04-Jul-2017 18:18:40] ERROR: failed to open configuration file '/private/etc/php-fpm.conf': No such file or directory (2)
[04-Jul-2017 18:18:40] ERROR: failed to load configuration file '/private/etc/php-fpm.conf'

我检查了下本机的php-fpm.conf放在

/usr/local/etc/php/7.0/php-fpm.conf

于是修改配置

php-fpm --fpm-config /usr/local/etc/php/7.0/php-fpm.conf

继续报错

yokedeMacBook-Pro999:7.0 jx$ php-fpm --fpm-config /usr/local/etc/php/7.0/php-fpm.conf
[04-Jul-2017 18:23:24] ERROR: failed to open error_log (/usr/var/log/php-fpm.log): No such file or directory (2)
[04-Jul-2017 18:23:24] ERROR: failed to post process the configuration
[04-Jul-2017 18:23:24] ERROR: FPM initialization failed

错误信息显示:不能正确的打开”日志“文件,原因是默认在/usr/var目录下工作,可以修改配置文件指定正确的日志文件路径

php-fpm --fpm-config /usr/local/etc/php/7.0/php-fpm.conf --prefix /usr/local/var

可以成功运行了,错误文件会放在 /usr/local/var/log/php-fpm.log

    原文作者:jnxc1888
    原文地址: https://www.jianshu.com/p/c9306c69e8b4
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞