1

我在我的 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)
4

2 回答 2

1

Have a look at your local.xml file and inspect the cache tag. In my case, while wanting to desactivate the cache, I had commented out everything inside this tag (apc, memcahced, etc) but I had left the tag itself outside of the comment which gave me errors similar as described above.

So try this :

<!--
<cache>
<backend>Apc</backend>
....
</cache>
-->

but not this :

<cache>
<!-- 
    <backend>Apc</backend>
     .... 
-->
</cache>

Of course, after that you no more use any cache but at least you may know where the error is coming from.

于 2013-11-16T12:45:47.377 回答
0

此问题与文件权限有关。确保 Web 服务器对缓存文件夹具有读/写权限。默认缓存文件夹位于:

<webroot>/var/cache/

请注意,缓存文件仅由文件所有者设置为读/写,因此存在限制。

于 2013-06-11T06:22:04.097 回答