当打开一个页面时,可能会收到一个错误信息,现在就是这样。
其他人有这个问题或者想知道如何解决这个问题或从哪里开始寻找?
/**
* 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 :(得分:2)
我早些时候在我的博客上发布了这个内容,但在仔细搜索后我想出来我也想在这里发布解决方案。
问题是影响版本高达5.3.3(https://bugs.php.net/bug.php?id=50027)的PHP错误。该错误与垃圾收集问题有关,该问题与能够访问配置选项对象上的属性有关。这就是为什么有些人在增加内存限制后会看到差异 - 它会在垃圾收集发生时产生影响。
结果是在app / code / core / Mage / Core / Model / Config / Options.php中的_construct()中,即使$ this是一个有效对象,任何尝试读取$ this的任何属性报告$ this是非对象的错误。
因此,唯一可靠的修复方法是将PHP升级到大于5.3.3的版本
答案 1 :(得分:0)
我有完全相同的问题!你能解决它吗?
在php.ini中占用内存已经工作了一段时间,但随后又出现了错误。
点击此处了解更多信息: http://www.magentocommerce.com/boards/viewthread/43941/P15/
迎接
答案 2 :(得分:0)
尝试查看php.ini文件中的内存设置。这应该是512M或更高。默认情况下,它可能是128M。
另请查看cron在服务器上运行的频率。
另请查看与DB的最大用户连接。
对于Magento,您可能需要在php.ini文件中使用类似于max_connections = 500的内容。
我过去经历过同样的问题,看起来像重置cron作业的频率回到Magento默认为我们固定。
代码当然没有错。它本质上是php.ini配置或服务器配置。