Activating error messages in laravel 4.2

天涯浪子 提交于 2019-12-12 04:53:53

问题


I am using laravel 4.2. It is basically a fresh installation. However, when receiving an error I get a page with:

Whoops, looks like something went wrong.

How to activate detailed error messages during development?

I appreciate your answer!


回答1:


It's not the way you should do. You should use environments for that.

Go to bootstrap\start.php.

In:

$env = $app->detectEnvironment(array(     
    'local' => array('yourpcname'),    
));

Put your PC name here.

Now in app/config/app.php make sure you have:

'debug' => false,

because you don't want to display errors when on production and you could forget about changing it when moving on production.

Now in app/config/local/app.php make sure you have:

'debug' => true,

Now in local environment you will have displayed errors in details and when moving to production standard messages as you have no (of course unless you won't create custom error page for that).




回答2:


Go to project/app/config/app.php and set debug = true

To have it be set to true in dev. and false on production look into setting up environment variables.



来源:https://stackoverflow.com/questions/26318052/activating-error-messages-in-laravel-4-2

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!