Home >Backend Development >PHP Tutorial >Why is the PHP-FPM error log not displayed under Nginx?

Why is the PHP-FPM error log not displayed under Nginx?

WBOY
WBOYOriginal
2016-08-04 09:22:121823browse

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:

Why is the PHP-FPM error log not displayed under Nginx?

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:

Why is the PHP-FPM error log not displayed under Nginx?

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?

Reply content:

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:

Why is the PHP-FPM error log not displayed under Nginx?

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:

Why is the PHP-FPM error log not displayed under Nginx?

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;

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn