dongtangu6889 2011-03-09 18:45
浏览 39
已采纳

升级到CodeIgniter 2.0,但现在我的php错误没有出现在日志中,我该怎么办?

OK, so I wrote an app using CodeIgniter 1.7.3 and everything was dandy.

then i moved to CodeIgniter 2.0 and it all works fine, except now it doesn't display errors in my php_error.log

so for example if i had a typo in a method name, I used to get something like:

[04-Feb-2011 16:20:01] PHP Fatal error: Call to undefined method Some_controller::my_method() in /Applications/MAMP/htdocs/application/controllers/some_controller.php on line 61

now i get nothing. just the 500 servlet exception in my browser window.

So far ive checked my php.ini which has error_reporting = E_ALL and log_errors = On also display_errors = On (even though i think this logs to the screen no the file)

i just tried an intentional broken non-codeigniter php file and I do get an error in my log like:

[10-Mar-2011 02:47:02] PHP Fatal error: Call to undefined function fake_method() in /Applications/MAMP/htdocs/test.php on line 2

so it appears to only be codeigniter which doesnt log.

my config/config.php has logging set like this: $config['log_threshold'] = 4;

also index.php has error_reporting(E_ALL);

Its such a pain to debug when I dont get line numbers... Can anyone else tell me what else I should change/check to get my logging back?

  • 写回答

4条回答 默认 最新

  • dtgsl60240 2011-03-20 04:46
    关注

    so I discovered that I had auto-loaded a library (paypal_lib) which for some reason had error_reporting(0) at the top of it.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(3条)

报告相同问题?

悬赏问题

  • ¥15 基于卷积神经网络的声纹识别
  • ¥15 Python中的request,如何使用ssr节点,通过代理requests网页。本人在泰国,需要用大陆ip才能玩网页游戏,合法合规。
  • ¥100 为什么这个恒流源电路不能恒流?
  • ¥15 有偿求跨组件数据流路径图
  • ¥15 写一个方法checkPerson,入参实体类Person,出参布尔值
  • ¥15 我想咨询一下路面纹理三维点云数据处理的一些问题,上传的坐标文件里是怎么对无序点进行编号的,以及xy坐标在处理的时候是进行整体模型分片处理的吗
  • ¥15 CSAPPattacklab
  • ¥15 一直显示正在等待HID—ISP
  • ¥15 Python turtle 画图
  • ¥15 stm32开发clion时遇到的编译问题