질문Q #24258
ci3 버전 캐쉬 오류 질문드립니다.
jinowe2022-04-27 04:58:34

회원가입 또는 로그인을 했을 때

Cache adapter "file" and backup "file" are both unavailable. Cache is now using "Dummy" adapter.

이러한 오류가 나고있습니다. 캐시가 중복으로 사용되서 생겨나는 오류인 것 같은데,

오랜시간 실마리를 찾을 수 없어서 질문 드립니다.

원인이 무엇인가요?

답변2
#1 변종원(웅파) 2022-04-27 08:31:39

캐시 디렉토리 쓰기 퍼미션 확인해보세요.

ci3 소스에서 Cache adapter로 검색하시면 선언한 아답터가 지원안될때 그리고 백업 아답터도 지원이 안될때 나오는 메세지 입니다.

 

public function __construct($config = array())
{
   isset($config['adapter']) && $this->_adapter = $config['adapter'];
   isset($config['backup']) && $this->_backup_driver = $config['backup'];
   isset($config['key_prefix']) && $this->key_prefix = $config['key_prefix'];

   // If the specified adapter isn't available, check the backup.
   if ( ! $this->is_supported($this->_adapter))
   {
      if ( ! $this->is_supported($this->_backup_driver))
      {
         // Backup isn't supported either. Default to 'Dummy' driver.
         log_message('error', 'Cache adapter "'.$this->_adapter.'" and backup "'.$this->_backup_driver.'" are both unavailable. Cache is now using "Dummy" adapter.');
         $this->_adapter = 'dummy';
      }
      else
      {
         // Backup is supported. Set it to primary.
         log_message('debug', 'Cache adapter "'.$this->_adapter.'" is unavailable. Falling back to "'.$this->_backup_driver.'" backup adapter.');
         $this->_adapter = $this->_backup_driver;
      }
   }
}
#2 한대승(불의회상) 2022-04-27 09:56:49

캐시 드라이버 지정시 백업캐시는 메인과 다른 드라이버 지정이 필요합니다.

드라이버 지정을 아래와 같이 수정해 보세요.

$this->load->driver('cache', array('adapter' => 'file', 'backup' => 'dummy'));