2017-06-05 127 views
1

当我在服务器上更新后端时,可能会发生错误。如果是,则会显示错误日志。有没有办法隐藏整个世界的所有细节,只显示如下内容:“发生错误。”为管理员?十月CMS:错误登录前端

感谢您的帮助。

+1

您是否启用了调试模式? – dragontree

回答

0

在撰写本文时,10月安装时关闭了调试模式。您应该在生产中启用它。打开PHP文件config/app.php并将调试值更新为false

/* 
|-------------------------------------------------------------------------- 
| Application Debug Mode 
|-------------------------------------------------------------------------- 
| 
| When your application is in debug mode, detailed error messages with 
| stack traces will be shown on every error that occurs within your 
| application. If disabled, a simple generic error page is shown. 
| 
| You can create a CMS page with route "/error" to set the contents 
| of this page. Otherwise a default error page is shown. 
| 
*/ 

'debug' => true, 

这会将错误转换为通用并且由文档推荐。

http://octobercms.com/docs/setup/configuration#debug-mode

重要:在app.debug设置始终设置为false用于生产环境。

+0

第二句:你应该**在生产中禁用**。或者你应该在开发时启用**。 – Ametad