Home  >  Article  >  Backend Development  >  How to enable the error log of php-fpm?

How to enable the error log of php-fpm?

青灯夜游
青灯夜游Original
2020-11-05 16:24:283812browse

How to enable php-fpm error log: 1. Configure php-fpm.conf, add "error_log=log/php_fpm.log" and "catch_workers_output=yes"; 2. Modify the configuration in php.ini; 3. Restart php-fpm.

How to enable the error log of php-fpm?

Recommended: "PHP Video Tutorial"

Enable php-fpm php error log Method

1. Modify the configuration in php-fpm.conf. If not, please add:

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

2. Modify the configuration in php.ini. If not, add it. :

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

3. Restart php-fpm

systemctl restart php-fpm

When PHP executes an error, you can see the error log in "/usr/local/php/var/log/php_error_log"

For more programming-related knowledge, please visit: Programming Video! !

The above is the detailed content of How to enable the error log of php-fpm?. For more information, please follow other related articles on the PHP Chinese website!

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