激活Laravel 4.2中的错误消息 [英] Activating error messages in laravel 4.2

查看:69
本文介绍了激活Laravel 4.2中的错误消息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用laravel 4.2.它基本上是一个全新的安装.但是,当收到错误消息时,我得到一个页面:

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?

感谢您的回答!

推荐答案

这不是您应该采取的方法.您应该为此使用环境.

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

转到bootstrap\start.php.

在:

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

在此处输入您的PC名称.

Put your PC name here.

现在在app/config/app.php中,请确保您拥有:

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.

现在在app/config/local/app.php中,请确保您具有:

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).

这篇关于激活Laravel 4.2中的错误消息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆