我在我的magento网站的系统日志中遇到了一些警告,其中一些我解决了,但其中一些我找不到也不在这里。
系统日志说:
2012-08-10T13:09:18+00:00 ERR (3): Warning: array_merge(): Argument #1 is not an array in /var/www/sites/mysite.com/app/code/core/Mage/Core/Model/App.php on line 395
在phpfile中,这是部分行395在顶部
$options = array_merge($options, $cacheInitOptions);
$this->_cache = Mage::getModel('core/cache', $options);
$this->_isCacheLocked = false;
return $this;
2012-08-10T13:09:18+00:00 ERR (3): Recoverable Error: Argument 1 passed to Mage_Core_Model_Cache::__construct() must be an array, null given, called in /var/www/sites/mysite.com/app/code/core/Mage/Core/Model/Config.php on line 1350 and defined in /var/www/sites/mysite.com/app/code/core/Mage/Core/Model/Cache.php on line 105
Config php.
$className = $this->getModelClassName($modelClass);
if (class_exists($className)) {
Varien_Profiler::start('CORE::create_object_of::'.$className);
1350 $obj = new $className($constructArguments);
Varien_Profiler::stop('CORE::create_object_of::'.$className);
return $obj;
Cache.php line 105= public function __construct(array $options = array()
2012-08-10T13:09:18+00:00 ERR (3): Recoverable Error: Argument 1 passed to Mage_Core_Model_Cache::_getBackendOptions() must be an array, null given, called in /var/www/sites/mysite.com/app/code/core/Mage/Core/Model/Cache.php on line 119 and defined in /var/www/sites/mysite.com/app/code/core/Mage/Core/Model/Cache.php on line 141
cache.php
line 119 $backend = $this->_getBackendOptions($options);
line 141 protected function _getBackendOptions(array $cacheOptions)
2012-08-10T13:09:18+00:00 ERR (3): Recoverable Error: Argument 1 passed to Mage_Core_Model_Cache::_getFrontendOptions() must be an array, null given, called in /var/www/sites/mysite.com/app/code/core/Mage/Core/Model/Cache.php on line 120 and defined in /var/www/sites/mysite.com/app/code/core/Mage/Core/Model/Cache.php on line 288
cache.php
line 120 $frontend = $this->_getFrontendOptions($options);
line 288 protected function _getFrontendOptions(array $cacheOptions)
答案 0 :(得分:1)
查看local.xml文件并检查缓存标记。在我的情况下,虽然想要取消激活缓存,但我已经注释掉了这个标签内的所有内容(apc,memcahced等)但是我将标签本身留在了注释之外,这给了我类似于上面描述的错误。
所以试试这个:
<!--
<cache>
<backend>Apc</backend>
....
</cache>
-->
但不是这样:
<cache>
<!--
<backend>Apc</backend>
....
-->
</cache>
当然,之后您不再使用任何缓存,但至少您可能知道错误的来源。
答案 1 :(得分:0)
此问题与文件权限有关。确保Web服务器具有对缓存文件夹的读/写权限。默认情况下,缓存文件夹位于:
<webroot>/var/cache/
请注意,缓存文件设置为仅由文件所有者读/写,因此限制。