How to print error log in php

王林
Release: 2023-03-04 11:30:02
Original
5416 people have browsed it

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

2, modify the php.ini configuration file

log_errors = on
error_log   = /user/local/php/log/error_log
Copy after login

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
Copy after login
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);
Copy after login
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!

Related labels:
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
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!