如何配置Codeigniter报告所有错误? [英] How to configure Codeigniter to report all errors?

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

问题描述

我有一行 - $ autoload ['libraries'] = array('database'); ,在CI的 autoload.php 。因为这样我得到一个空白页。当我删除'数据库',然后我开始获取输出。

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版本。对于< 2.x编辑顶层index.php并调整error_reporting函数以使用E_ALL

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报告所有错误?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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