magento - "Could not determine temp directory, please specify a cache_dir manually"

标签 magento caching

Magento 管理员抛出异常:

Could not determine temp directory, please specify a cache_dir manually


它是在新托管包上的全新安装。

最佳答案

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

很多人建议修改文件:/lib/Zend/Cache/Backend/File.php来解决这个问题。然而,当你升级你的 Magento 时,它可能是一个陷阱,因为这个文件作为 Magento 的核心文件驻留。我建议使用 Magento 的覆盖功能。

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

然后在第 91 行或该行附近,您会发现:

'cache_dir' => null,

改成:
'cache_dir' => "var/tmp/",

您可以随时随地更改缓存文件夹。
现在在 var 文件夹下创建一个名为 tmp(或您在上面给出的任何名称)的目录并将权限更改为 777 如有必要。

关于magento - "Could not determine temp directory, please specify a cache_dir manually",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20773160/

相关文章:

Magento 2 - 如何在另一个phtml文件、xml布局、静态 block 和cms页面中调用自定义phtml文件

javascript - Magento:可配置产品选项未填充下拉列表

php - WindowsAzure : Blob cache experiments with phpazure

caching - 在 spark streaming 中,我必须在 cache() 或 persist() 之后调用 count() 才能强制缓存/持久性真正发生吗?

c++ - 需要缓存友好的数据结构来将字母的邻居存储在二维数组中

mysql - hibernate JPA+mysql : can not disable caching in createNativeQuery

java - 清除Java应用程序的缓存

php - Magento 中的自定义 Rest Api

magento - 为 Magento 的某一页面设置面包屑?

magento - "Suspected Fraud"完成magento付款后的状态?