为什么PHP不需要抛出错误?

时间:2013-03-15 07:00:44

标签: php error-handling require

所以我听说require会产生致命错误(E_COMPILE_ERROR)并停止脚本。

它确实停止了脚本,我得到了空白页面。但我检查了错误日志,发现没有错误。 (Nginx的)

我试图要求“../lib/Smarty.class.php”,但我没有上传lib文件夹。我期待看到致命的错误,但没有。

为什么?

我有

error_reporting(E_ALL);

以及我的剧本。

我错过了什么?

2 个答案:

答案 0 :(得分:2)

用于将显示错误设置为1,然后设置为error_reporting ...

    // change settings for error handler to show errors
    // $this setup is used for checking errors for development to be shown.... 
    ini_set('display_errors', 1);
    error_reporting(E_ALL);

    //then if you want to have error handler use
   error_log(); //to log your errors within a specify location..

答案 1 :(得分:0)

  

我错过了什么?

display_errors设置。

相关问题