2012-04-19 54 views
0

當打開一個頁面時,可能會得到一個錯誤信息,甚至現在。任何頁面可能會得到錯誤包括管理頁面

其他人有這個問題或有任何想法如何解決這個問題或從哪裏開始尋找?

/** 
* Retrieve application root absolute path 
* 
* @param string $type 
* @return string 
*/ 
public static function getBaseDir($type = \'base\') 
{ 
    return self::getConfig()->getOptions()->getDir($type); // Line 296 
} 
Notice: Trying to get property of non-object in /var/www/html/magento/lib/Varien/Autoload.php on line 81 
Notice: Trying to get property of non-object in /var/www/html/magento/lib/Varien/Autoload.php on line 84 
Notice: Trying to get property of non-object in /var/www/html/magento/lib/Varien/Autoload.php on line 81 
Notice: Trying to get property of non-object in /var/www/html/magento/lib/Varien/Autoload.php on line 84 
Notice: Trying to get property of non-object in /var/www/html/magento/lib/Varien/Autoload.php on line 81 
Notice: Trying to get property of non-object in /var/www/html/magento/lib/Varien/Autoload.php on line 84 
Notice: Trying to get property of non-object in /var/www/html/magento/lib/Varien/Autoload.php on line 81 
Notice: Trying to get property of non-object in /var/www/html/magento/lib/Varien/Autoload.php on line 84 
Notice: Trying to get property of non-object in /var/www/html/magento/lib/Varien/Autoload.php on line 81 
Notice: Trying to get property of non-object in /var/www/html/magento/lib/Varien/Autoload.php on line 84 
Notice: Trying to get property of non-object in /var/www/html/magento/lib/Varien/Autoload.php on line 81 
Notice: Trying to get property of non-object in /var/www/html/magento/lib/Varien/Autoload.php on line 84 
Notice: Trying to get property of non-object in /var/www/html/magento/lib/Varien/Autoload.php on line 81 
Notice: Trying to get property of non-object in /var/www/html/magento/lib/Varien/Autoload.php on line 84 
Notice: Trying to get property of non-object in /var/www/html/magento/lib/Varien/Autoload.php on line 81 
Notice: Trying to get property of non-object in /var/www/html/magento/lib/Varien/Autoload.php on line 84 
Notice: Trying to get property of non-object in /var/www/html/magento/lib/Varien/Autoload.php on line 81 
Notice: Trying to get property of non-object in /var/www/html/magento/lib/Varien/Autoload.php on line 84 
Notice: Trying to get property of non-object in /var/www/html/magento/lib/Varien/Object.php on line 99 
Notice: Trying to get property of non-object in /var/www/html/magento/lib/Varien/Object.php on line 115 
Notice: Trying to get property of non-object in /var/www/html/magento/lib/Varien/Object.php on line 115 
Warning: array_keys() expects parameter 1 to be array, null given in /var/www/html/magento/lib/Varien/Object.php on line 115 
Warning: array_intersect(): Argument #1 is not an array in /var/www/html/magento/lib/Varien/Object.php on line 115 
Notice: Trying to get property of non-object in /var/www/html/magento/app/code/core/Mage/Core/Model/Config/Options.php on line 146 
Notice: Trying to get property of non-object in /var/www/html/magento/app/code/core/Mage/Core/Model/Config/Options.php on line 65 
Notice: Trying to get property of non-object in /var/www/html/magento/app/code/core/Mage/Core/Model/Config/Options.php on line 66 
Notice: Trying to get property of non-object in /var/www/html/magento/app/code/core/Mage/Core/Model/Config/Options.php on line 67 
Notice: Trying to get property of non-object in /var/www/html/magento/app/code/core/Mage/Core/Model/Config/Options.php on line 68 
Notice: Trying to get property of non-object in /var/www/html/magento/app/code/core/Mage/Core/Model/Config/Options.php on line 69 
Notice: Trying to get property of non-object in /var/www/html/magento/app/code/core/Mage/Core/Model/Config/Options.php on line 70 
Notice: Trying to get property of non-object in /var/www/html/magento/lib/Varien/Autoload.php on line 81 
Notice: Trying to get property of non-object in /var/www/html/magento/lib/Varien/Autoload.php on line 84 
Notice: Trying to get property of non-object in /var/www/html/magento/app/code/core/Mage/Core/Model/App.php on line 1315 
Notice: Trying to get property of non-object in /var/www/html/magento/app/code/core/Mage/Core/Model/App.php on line 813 
Notice: Trying to get property of non-object in /var/www/html/magento/lib/Varien/Autoload.php on line 81 
Notice: Trying to get property of non-object in /var/www/html/magento/lib/Varien/Autoload.php on line 84 
Notice: Trying to get property of non-object in /var/www/html/magento/lib/Varien/Autoload.php on line 81 
Notice: Trying to get property of non-object in /var/www/html/magento/lib/Varien/Autoload.php on line 84 
Notice: Trying to get property of non-object in /var/www/html/magento/app/code/core/Mage/Core/Model/Config.php on line 224 
Fatal error: Call to a member function getDir() on a non-object in /var/www/html/magento/app/Mage.php on line 296 

回答

0

試着看一下內存在php.ini文件中設定。這應該是512M或更高。默認情況下它可能是128M。

另請看看cron在服務器上的運行頻率。

另請參閱數據庫的最大用戶連接。

對於Magento,您可能想在php.ini文件中使用類似max_connections = 500的東西。

我在過去經歷過同樣的問題,看起來像重置cron作業的頻率返回到Magento默認已爲我們確定。

當然沒有錯的代碼。它基本上是php.ini配置或服務器配置。

2

我之前在博客上發佈了一篇完整的文章,但是經過努力研究,我發現我也會在這裏發佈解決方案。

問題是影響版本高達5.3.3的PHP錯誤(https://bugs.php.net/bug.php?id=50027)。這個bug涉及到一個垃圾收集問題,它可以通過訪問配置選項對象上的屬性來解決這個問題。這就是爲什麼有些人在增加內存限制後會看到差異 - 這會影響垃圾收集的時間。

結果是在app/code/core/Mage/Core/Model/Config/Options.php中的_construct()中,即使$ this是一個有效的對象,任何試圖讀取$這報告錯誤$ this是一個非對象。

因此,唯一強大的修復方法是將PHP升級到大於5.3.3的版本。