How to have PHP display errors? (I've added ini_set and error_reporting, but just gives 500 on errors)

后端 未结 7 1516
花落未央
花落未央 2020-12-08 19:39

So, I don\'t really have any errors in my current web page, but I want to be able to see an error when they pop up, instead of the HTTP 500 error page. I googled around a bi

7条回答
  •  情歌与酒
    2020-12-08 20:16

    To people using Codeigniter (i'm on C3):

    The index.php file overwrite php.ini configuration, so on index.php file, line 68:

    case 'development':
            error_reporting(-1);
            ini_set('display_errors', 1);
        break;
    

    You can change this option to set what you need. Here's the complete list:

    1   E_ERROR
    2   E_WARNING
    4   E_PARSE
    8   E_NOTICE
    16  E_CORE_ERROR
    32  E_CORE_WARNING
    64  E_COMPILE_ERROR
    128 E_COMPILE_WARNING
    256 E_USER_ERROR
    512 E_USER_WARNING
    1024    E_USER_NOTICE
    6143    E_ALL
    2048    E_STRICT
    4096    E_RECOVERABLE_ERROR
    

    Hope it helps.

提交回复
热议问题