2012-08-10 86 views
1

我在我的magento网站的系统日志中遇到了一些警告,其中一些我解决了,但其中一些我不能在这里找到。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

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

<webroot>/var/cache/ 

请注意缓存文件设置为只能由文件所有者读取/写入,因此受到限制。

1

查看您的local.xml文件并检查缓存标记。在我的情况下,虽然想要停用缓存,但我已经注释掉了这个标签(apc,memcahced等)中的所有内容,但是我已经将标签本身留在评论之外,这给了我类似上面描述的错误。

那么试试这个:

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

但不是这样的:

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

当然,在这之后,你不再使用任何缓存,但至少你可以知道哪里有错误的来源。