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

How to set printing error prompt in php

藏色散人
Release: 2023-03-17 06:08:01
Original
1837 people have browsed it

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
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

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

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

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!

Related labels:
php
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