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条)

报告相同问题?

悬赏问题

  • ¥100 set_link_state
  • ¥15 虚幻5 UE美术毛发渲染
  • ¥15 CVRP 图论 物流运输优化
  • ¥15 Tableau online 嵌入ppt失败
  • ¥100 支付宝网页转账系统不识别账号
  • ¥15 基于单片机的靶位控制系统
  • ¥15 真我手机蓝牙传输进度消息被关闭了,怎么打开?(关键词-消息通知)
  • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
  • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
  • ¥15 手机接入宽带网线,如何释放宽带全部速度