1.修改php-fpm.conf中配置 没有则增加
catch_workers_output = yes
error_log = "/usr/local/lnmp/php/var/log/error_log"
2.修改php.ini中配置,没有则增加
log_errors = On
error_log = "/usr/local/lnmp/php/var/log/error_log"
error_reporting=E_ALL&~E_NOTICE
3.重启php-fpm,
当PHP执行错误时就能看到错误日志在"/usr/local/lnmp/php/var/log/error_log"中了
优先级别由低至高如下,php.ini < php-fpm.conf < *.php
相关链接
1 nginx php-fpm记录php错误日志怎么配置
https://www.cnblogs.com/examine/p/4708303.html
2 PHP错误日志,解决不显示不记录日志文件等疑难杂症
https://cloud.tencent.com/developer/article/1148532