How to display PHP errors in code output?

后端 未结 3 2072
离开以前
离开以前 2020-12-03 00:59

When executing a PHP page through browser , we will just get the output but not the errors in code.

how can i view the errors occurred by the code in the backend??

3条回答
  •  春和景丽
    2020-12-03 01:40

    Try -1. From the documentation, "Passing in the value -1 will show every possible error, even when new levels and constants are added in future PHP versions."

    // Report all PHP errors
    error_reporting(-1);
    

    If that doesn't work, try to do an ini_set:

    // Same as error_reporting(E_ALL);
    ini_set('error_reporting', E_ALL);
    

提交回复
热议问题