Home >Backend Development >PHP Problem >How to enable errors in php fpm

How to enable errors in php fpm

藏色散人
藏色散人Original
2020-08-15 09:54:112982browse

php fpm method to enable errors: first find and open the "php-fpm.conf" file; then add the content as "error_log = log/php_error_log"; then modify the configuration in "php.ini"; and finally restart "php-fpm" will do.

How to enable errors in php fpm

Recommended: "PHP Video Tutorial"

Enable php-fpm php error log

Make the following settings to see how php-fpm does not record PHP error logs under nginx:

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

The code is as follows:

[global]
error_log = log/php_error_log
[www]
catch_workers_output = yes

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

The code is as follows:

log_errors = On
error_log = "/usr/local/php/var/log/error_log"
error_reporting=E_ALL&~E_NOTICE

3. Restart php- fpm

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

If it appears:

The code is as follows:

[root@localhost etc]# service php-fpm restart
Gracefully shutting down php-fpm . done
Starting php-fpm [17-Apr-2014 18:40:52] ERROR: [/usr/local/php/etc/php-fpm.conf:5] unknown entry 'catch_workers_
[17-Apr-2014 18:40:52] ERROR: failed to load configuration file '/usr/local/php/etc/php-fpm.conf'
[17-Apr-2014 18:40:52] ERROR: FPM initialization failed
 failed

In the first step, please carefully write the configuration into the corresponding group, otherwise the above message will appear:

The code is as follows:

ERROR: [/usr/local/php/etc/php-fpm.conf:5] unknown entry ‘catch_workers_output'

The above is the detailed content of How to enable errors in 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