Home > Backend Development > PHP Problem > How to prompt all errors in php

How to prompt all errors in php

藏色散人
Release: 2023-03-17 14:16:01
Original
1919 people have browsed it

How to implement php to prompt all errors: 1. Create a php file; 2. Define a function "function show_all_errors(){...}"; 3. Write "if(! ini_get('display_errors')){ini_set('display_errors','On');}error_reporting(E_ALL);" The statement can be used to display all PHP errors.

How to prompt all errors in php

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

php How to prompt all errors?

PHP Manually enable display of all errors

I often encounter the problem that the configuration of php.ini prevents PHP execution errors from being displayed. It is really troublesome to change php.ini every time. , so simply write a function to display all PHP errors (very convenient to use in various debugging modes):

function show_all_errors(){
if(!ini_get('display_errors')){
ini_set('display_errors','On');
}
error_reporting(E_ALL);
}
Copy after login

Recommended study: "PHP Video Tutorial"

The above is the detailed content of How to prompt all errors 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