本文介绍了如何配置 Codeigniter 报告所有错误?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一行 - $autoload['libraries'] = array('database');,在 CI 的 autoload.php 中.因此,我得到了一个空白页.当我删除 'database', 选项后,我开始获取输出.

I had a line - $autoload['libraries'] = array('database');, in CI's autoload.php. Because of this I was getting a blank page. When I removed the 'database', option then I started getting the output.

现在我的问题不是如何配置数据库,而是如何配置CI来说出它的想法.当 'database' 启用时,我得到的只是一个完整的空白页面.php日志没有错误,Apache日志没有错误,CI日志没有错误.在 PHP 中,我设置了 E_ALL.在我的 CI 配置中,我将 log_threshold 设置为 4,即应该记录所有消息.我还需要做什么?

Now my question is not how to configure the database, but how to configure CI to speak its mind. When 'database' was enabled all I got was a complete blank page. No error in php log, no error in Apache log, no error in CI log. In PHP I have set E_ALL. In my CI config I have set log_threshold to 4, i.e. all messages should be logged. What more do I need to do?

推荐答案

这取决于您的 CI 版本.对于

It depends on your version of CI. For < 2.x edit the top level index.php and adjust the error_reporting function to use E_ALL"

error_reporting(E_ALL);

对于 >= 2.x 编辑顶级 index.php 并确保 ENVIRONMENT 设置为:

For >= 2.x edit the top level index.php and make sure ENVIRONMENT is set as:

define('ENVIRONMENT', 'development');

将 error_reporting 设置为 E_ALL.

which sets the error_reporting to E_ALL.

这篇关于如何配置 Codeigniter 报告所有错误?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-01 00:09