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