Home > Backend Development > PHP Problem > How to check error messages in php

How to check error messages in php

王林
Release: 2023-03-03 18:02:02
Original
3796 people have browsed it

How to view error information in php: First use the ini_set() function to turn on the error prompt, such as [ini_set("display_errors", "On")]; then use the error_reporting() function to set the error reporting level.

How to check error messages in php

PHP ini_set is used to set the value of php.ini, which takes effect when the function is executed. After the script ends, the setting becomes invalid. The configuration can be modified without opening the php.ini file.

(Recommended tutorial: php graphic tutorial)

Grammar format:

string ini_set(string $varname, string $newvalue)
Copy after login

error_reporting() function specifies which error to report, the function settings The error reporting level for the current script.

(Video tutorial recommendation: php video tutorial)

Grammar format:

error_reporting(report_level)
Copy after login

Just add the following two lines of code to the execution code.

ini_set("display_errors","On");
error_reporting(E_ALL);
Copy after login

The above is the detailed content of How to check error messages 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
Latest Issues
php data acquisition?
From 1970-01-01 08:00:00
0
0
0
PHP extension intl
From 1970-01-01 08:00:00
0
0
0
How to learn php well
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template