代码改变世界

初次安装Magento商城 后台报错的解决方案

2011-07-13 17:21  斌哥tobin  阅读(1158)  评论(1)    收藏  举报

今天初次安装Magento, 开始装的是英文版,后来又找到中文版

安装后在后台都有同一个错误,就是登陆后台,随便点击一个链接,都有报错

There has been an error processing your request
Exception printing is disabled by default for security reasons.

Error log record number: xxxxxxxxxx(这是一串数字)

 

问Google,找到解决方案

步骤1

重命名 errors/local.xml.sample 为 local.xml

这样修改可以看到详细的错误信息:

Could not determine temp directory, please specify a cache_dir manually

Trace:
#0 F:\Work\makingware_ce-1.5.2\lib\Zend\Cache\Backend.php(197): Zend_Cache::throwException('Could not deter...')
#1 F:\Work\makingware_ce-1.5.2\lib\Zend\Cache\Backend\File.php(123): Zend_Cache_Backend->getTmpDir()
#2 F:\Work\makingware_ce-1.5.2\lib\Zend\Cache.php(153): Zend_Cache_Backend_File->__construct(Array)
#3 F:\Work\makingware_ce-1.5.2\lib\Zend\Cache.php(94): Zend_Cache::_makeBackend('File', Array, false, false)
#4 F:\Work\makingware_ce-1.5.2\lib\Zend\Locale\Data.php(314): Zend_Cache::factory('Core', 'File', Array, Array)
#5 F:\Work\makingware_ce-1.5.2\app\code\core\Mage\Core\Block\Html\Calendar.php(42): Zend_Locale_Data::getList('zh_CN', 'days')
....后面省略

 

此错误说明是缓存目录需要手动设置

步骤2

修改文件 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
    );
复制代码

看到以上代码,设置 cache_dir

复制代码
    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
    );
复制代码

修改完成!

 

BTW:博客园添加新随笔的按钮,在Mathon3的极速模式(chrome模式)下点击不起作用!

 

编辑推荐:
· 我在厂里搞 wine 的日子
· 如何通过向量化技术比较两段文本是否相似?
· 35+程序员的转型之路:经济寒冬中的希望与策略
· JavaScript中如何遍历对象?
· 领域模型应用
阅读排行:
· 独立项目运营一周年经验分享
· 一款开源免费、通用的 WPF 主题控件包
· 独立开发,这条路可行吗?
· 【定时任务核心】究竟是谁在负责盯着时间,并在恰当时机触发任务?
· 解决了AI聊天的10个痛点后,我又做了一个新功能:交叉分析表
点击右上角即可分享
微信分享提示