Home >Backend Development >PHP Problem >How to enable errors in php fpm
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.
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!