[转]Class 'Think\Log' not found

转自: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

posted @ 2015-12-25 17:55  Athrun  阅读(2675)  评论(0编辑  收藏  举报