码迷,mamicode.com
首页 > 其他好文 > 详细

[转]Class 'Think\Log' not found

时间:2015-12-25 19:00:50      阅读:149      评论:0      收藏:0      [点我收藏+]

标签:

转自:http://www.thinkphp.cn/topic/26815.html

解决偶尔出现 Class ‘Think\Log‘ not found 的奇葩问题(并非每次必现,偶尔删除缓存可以解决,偶尔删除缓存页不行),php5.3版本bug(PHP 5.4.21已经fixed这个bug),set_error_handler处理函数无法调用spl_autoload_register来自动加载Log类的问题
解决方法:
文件:ThinkPHP/Library/Think/Think.class.php
位置:Storage::connect(STORAGE_TYPE); 后面添加一行代码 version_compare(PHP_VERSION, ‘5.4.21‘, ‘<‘) && Log::INFO;,在error_handler之前预先加载Log类
原因参考:
http://stackoverflow.com/questions/1942507/set-error-handler-function-not-calling-autoload] 
https://bugs.php.net/bug.php?id=47987 
https://bugs.php.net/bug.php?id=65322

[转]Class 'Think\Log' not found

标签:

原文地址:http://www.cnblogs.com/Athrun/p/5076616.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!