【发布时间】:2012-12-27 10:59:01
【问题描述】:
我想将本地开发发布到生产环境时遇到问题, 这个问题是关于错误消息处理的。当我使用开发环境访问我的站点时,可以显示错误,但在生产环境中不应显示错误。
我已尝试通过更改errors=>false 来在/fuel/app/config/config.php 中进行配置,并参考了此文档http://fuelphp.com/docs/general/configuration.html,但是当我通过在数据库查询中产生错误进行测试时,它仍然没有改变。
我也尝试在 index.php 中将 error_reporting 更改为 0 并将 display_errors 更改为 0,但仍然无法解决我的问题...
error_reporting(0);//error_reporting(-1);
ini_set('display_errors', 0);//ini_set('display_errors', 1);
如何在 FuelPHP 的生产环境中禁用错误消息?
【问题讨论】:
-
你认为
errors=>false为什么应该禁用这些?您在那里引用了哪个参考文献? -
你也试过设置
errors.throttle => 0 -
@hakre 我只是测试了希望禁用错误处理,因为在我测试之前仍然显示错误消息
'errors' => array( // Which errors should we show, but continue execution? 'continue_on' => array(), // How many errors should we show before we stop showing them? (prevents out-of-memory errors) 'throttle' => 10, // Should notices from Error::notice() be shown? 'notices' => false, -
@sean 结果相同,不断显示错误消息..:(
标签: php error-handling fuelphp