Home  >  Article  >  Backend Development  >  How to print error log in php

How to print error log in php

王林
王林Original
2020-08-12 15:55:175465browse

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);].

How to print error log in php

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_ALL
in 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!

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