Home > Article > Backend Development > How to print error log in php
How to print error logs in php: 1. Edit the php-fpm.conf configuration file; 2. Modify the php.ini configuration file; 3. Restart php-fpm; 4. Add [ini_set(' display_errors', 0);].
Specific method:
(Recommended tutorial: php graphic tutorial)
1. Modify the php-fpm.conf configuration file
catch_workers_output = yes error_log = log/php_error.log
2, modify the php.ini configuration file
log_errors = on error_log = /user/local/php/log/error_log
3, restart php-fpm
(Video tutorial recommendation: php video tutorial)
Note: If the php.ini file cannot be found, please enter phpinfo() on the page to find it. The php error log is not output to the log and screen
4. Modify
display_errors = off log_error = on error_reprting = E_ALLin the configuration file php.ini
5. Modify
ini_set('display_errors', 0); ini_set('error_reporting', E_ALL); ini_set('error_log', '日志文件'); ini_set('log_errors', 1);in the program
The above is the detailed content of How to print error log in php. For more information, please follow other related articles on the PHP Chinese website!