[轉]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


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM