Laravel4下的调试
在Laravel4中, 底层的错误不会被记录到日志文件中,也不会显示出来, 造成调试困难。可以临时修改'vendor/laravel/framework/src/Illuminate/Foundation/start.php'让错误显示到PHP错误日志里。
/*
|--------------------------------------------------------------------------
| Register Application Exception Handling
|--------------------------------------------------------------------------
|
| We will go ahead and register the application exception handling here
| which will provide a great output of exception details and a stack
| trace in the case of exceptions while an application is running.
|
*/
$app->startExceptionHandling();
if ($env != 'testing') ini_set('display_errors', 'Off');
注释掉上面两行代码, PHP默认的错误处理行为就会起作用了。