2012-08-10 88 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> 

當然,在這之後,你不再使用任何緩存,但至少你可以知道哪裏有錯誤的來源。