Home  >  Article  >  Backend Development  >  How to set printing error prompt in php

How to set printing error prompt in php

藏色散人
藏色散人Original
2022-10-18 10:14:301743browse

How to set printing error prompts in php: 1. Modify the php-fpm.conf configuration file; 2. Modify the php.ini configuration file; 3. Restart php-fpm; 4. Modify "ini_set( 'display_errors', 0);ini_set('error_reporting', E_ALL);ini_set('error_log', 'log file');".

How to set printing error prompt in php

The operating environment of this tutorial: Windows 7 system, PHP version 8.1, DELL G3 computer

Set up PHP error log Print

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

Note:

If the php.ini file cannot be found, please output phpinfo() on the page to find it

php error log is not output to the log and screen

3. Modify

display_errors = off
log_error = on
error_reprting = E_ALL

in the configuration file php.ini 4. Modify

ini_set('display_errors', 0);
ini_set('error_reporting', E_ALL);
ini_set('error_log', '日志文件');
ini_set('log_errors', 1);

in the program Recommended learning: "PHP Video Tutorial"

The above is the detailed content of How to set printing error prompt 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