Home >Backend Development >PHP Tutorial >Why is the PHP-FPM error log not displayed under Nginx?
I configured the LNMP environment under Ubuntu, where Nginx is configured with error logs and access logs, everything is normal.
At the same time, PHP-FPM configures error_log in pool/www.conf.
<code>catch_workers_output = yes php_admin_value[error_log] = /home/liyi/logs/php-error.log php_admin_flag[log_errors] = on</code>
At the same time, I print phpinfo(); as shown below:
But my php-error.log has no error log. Instead, the php fatal error message is printed in the nginx error log.
Nginx error log is as shown below:
PHP error log is completely blank.
I switched to the Homestead virtual machine and everything was normal, and the php error_log was displayed normally.
How to configure php error log?
I configured the LNMP environment under Ubuntu, where Nginx is configured with error logs and access logs, everything is normal.
At the same time, PHP-FPM configures error_log in pool/www.conf.
<code>catch_workers_output = yes php_admin_value[error_log] = /home/liyi/logs/php-error.log php_admin_flag[log_errors] = on</code>
At the same time, I print phpinfo(); as shown below:
But my php-error.log has no error log. Instead, the php fatal error message is printed in the nginx error log.
Nginx error log is as shown below:
PHP error log is completely blank.
I switched to the Homestead virtual machine and everything was normal, and the php error_log was displayed normally.
How to configure php error log?
1. Check whether your program has write permission to the error_log directory. It mainly depends on what identity you use to run php-fpm;