今天初次安裝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
);