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

How to enable errors in php fpm

藏色散人
Release: 2023-03-04 13:54:01
Original
2985 people have browsed it

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
Copy after login

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
Copy after login

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
Copy after login

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'
Copy after login

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!

Related labels:
fpm
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template