【问题标题】:Symfony error - Failed to write cache fileSymfony 错误 - 无法写入缓存文件
【发布时间】:2017-02-28 10:18:44
【问题描述】:

我继承了一个 Symphony 站点,但出现以下错误,

Fatal error: Uncaught exception 'RuntimeException' with message 'Failed to write cache file "/var/www/html/app/cache/prod/classes.php".' in /var/www/html/vendor/symfony/symfony/src/Symfony/Component/ClassLoader/ClassCollectionLoader.php:239

我做了一个chmod -R 777 cache,但没有运气。 classes.php 文件不存在。

【问题讨论】:

标签: php symfony caching


【解决方案1】:

如果你是 linux 用户,那么你需要触发下面列出的命令:

HTTPDUSER=`ps axo user,comm | grep -E '[a]pache|[h]ttpd|[_]www|[w]ww-data|[n]ginx' | grep -v root | head -1 | cut -d\  -f1`

sudo setfacl -R -m u:"$HTTPDUSER":rwX -m u:`whoami`:rwX var

sudo setfacl -dR -m u:"$HTTPDUSER":rwX -m u:`whoami`:rwX var

【讨论】:

  • 那你需要先安装acl使用sudo apt-get install acl
猜你喜欢
  • 2012-08-24
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2011-11-26
  • 2020-06-25
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多