今天初次安裝Magento, 開始裝的是英文版,後來又找到中文版安裝後在後台都有同一個錯誤,就是登陸後台,隨便點擊一個連結,都有報錯
There has been an error processing your request
Exception printing is disabled by default for security reasons.
Error log record number: xxxxxxxxxx(這是一串數字)
在var/report下能找到一上面數組明明的檔案。
開啟即可看到錯誤資訊:
a:5:{i:0;s:71:"Could not determine temp directory, please specify a cache_dir manually";i:1;s:4558:"#0 /lib/Zend/Cache/Backend.php(197): Zend_Cache::throwException('Could not deter...')
此錯誤說明是沒有找到快取檔案目錄,緩衝目錄需要手動設定
這裡我們需要修改檔案 lib\Zend\Cache\Backend\File.php
在第90行的位置
protected $_options = array( 'cache_dir' => null, 'file_locking' => true, 'read_control' => true, 'read_control_type' => 'crc32', 'hashed_directory_level' => 0, 'hashed_directory_umask' => 0700, 'file_name_prefix' => 'zend_cache', 'cache_file_umask' => 0600, 'metadatas_array_max_size' => 100 );
為
protected $_options = array( 'cache_dir' => 'var/cache', 'file_locking' => true, 'read_control' => true, 'read_control_type' => 'crc32', 'hashed_directory_level' => 0, 'hashed_directory_umask' => 0700, 'file_name_prefix' => 'zend_cache', 'cache_file_umask' => 0600, 'metadatas_array_max_size' => 100 );