“无法确定临时目录,请手动指定cache_dir" [英] "Could not determine temp directory, please specify a cache_dir manually"

查看:193
本文介绍了“无法确定临时目录,请手动指定cache_dir"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Magento管理员引发异常:

Magento admin throws an exception:

无法确定临时目录,请手动指定cache_dir

Could not determine temp directory, please specify a cache_dir manually

这是新安装的新主机程序包.

It is fresh instalation on new hosting package.

推荐答案

通常,如果tmp文件夹的权限设置错误,它将在共享虚拟主机中发生,但有时也会在单个服务器上发生.

Usually it will happen in shared web hosting, but also some times on individual server, if the permission of tmp folder is set wrong.

许多人建议修改文件: /lib/Zend/Cache/Backend/File.php解决此问题.但是,当您升级Magento时,这可能是一个陷阱,因为此文件位于Magento的核心文件中.我建议使用Magento的替代功能.

Many people suggest to modify the file: /lib/Zend/Cache/Backend/File.php to fix this problem. However, it may be a trap when you upgrade your Magento, as this file resides as core file of Magento. I recommend to use Magento's override feature.

首先,将/lib/Zend/Cache/Backend/File.php复制到/app/code/local/Zend/Cache/Backend/File.php.

然后在91行或此行附近,您将找到:

Then on line 91 or near this line, you will find:

'cache_dir' => null,

更改为:

'cache_dir' => "var/tmp/",

您可以随时随地更改缓存文件夹. 现在,在var文件夹下创建一个名为tmp(或上面输入的名称)的目录,并在必要时将权限更改为 777 .

You can change the cache folder wherever you want. Now create a directory named tmp(or whatever name you have given above) under var folder and change the permission to 777 if necessary.

这篇关于“无法确定临时目录,请手动指定cache_dir"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆