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.
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); }
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!