开启php-fpm php错误日志

进行如下的设置就能查看到nginx下php-fpm不记录php错误日志的方法:

1,修改php-fpm.conf中的配置,如果没有请增加:

复制代码 代码如下:

[global]
error_log = log/php_fpm.log
[www]
catch_workers_output = yes


2.修改php.ini中配置,没有则增加:

复制代码 代码如下:

log_errors = On
error_log = log/php_error_log
error_reporting=E_ALL&~E_NOTICE

error_reporting=E_ALL & ~E_DEPRECATED & ~E_STRICT

3.重启php-fpm

systemctl restart php-fpm

当PHP执行错误时就能看到错误日志在”/usr/local/php/var/log/php_error_log”中了

猜你喜欢

转载自www.cnblogs.com/ethanw97m/p/11326543.html