doulan2827 2013-02-09 16:35
浏览 46
已采纳

Heroku PHP应用程序无法写入雪松堆栈上的文件系统

I have a couple Heroku CakePHP apps running on the cedar stack. My app is erroring out on every request when the cache engine tries to write out to a file.

[Sat Feb 09 05:56:51 2013] [error] [client x.x.x.x] PHP Fatal error: Uncaught exception 'CacheException' with message 'Cache engine _cake_core_ is not properly configured.' in /app/www/lib/Cake/Cache/Cache.php:165
Stack trace:
#0 /app/www/lib/Cake/Cache/Cache.php(135): Cache::_buildEngine('_cake_core_')
#1 /app/www/app/Config/core.php(277): Cache::config('_cake_core_', Array)
#2 /app/www/lib/Cake/Core/Configure.php(76): include('/app/www/app/Co...')
#3 /app/www/lib/Cake/bootstrap.php(163): Configure::bootstrap(true)
#4 /app/www/app/webroot/index.php(82): include('/app/www/lib/Ca...')
#5 {main}
thrown in /app/www/lib/Cake/Cache/Cache.php on line 165

2013-02-09T05:56:51+00:00 app[web.1]: [Sat Feb 09 05:56:51 2013] [error] [client x.x.x.x] PHP Warning: /app/www/app/tmp/cache/persistent/ is not writable in /app/www/lib/Cake/Cache/Engine/FileEngine.php on line 336

2013-02-09T05:56:51+00:00 app[web.1]: [Sat Feb 09 05:56:51 2013] [error] [client x.x.x.x] PHP Warning: _cake_core_ cache was unable to write 'cake_dev_en-us' to File cache in /app/www/lib/Cake/Cache/Cache.php on line 309

I thought dynos on the cedar stack have writable ephemeral filesystems. Why am I getting not writable errors, and what can I do to fix them?

  • 写回答

2条回答 默认 最新

  • doulang6013 2013-02-10 14:22
    关注

    Your best bet would be to configure an actual cache system like Memcahier or even Redis. While you can normally write to the dynos, you have limited space and it will be lost on restart, and cause issues if you're using more than one dyno.

    This specific instance could be explained by limitations in the apache conf, or dir settings in the buildpack. I'm sure not all directories are writable. If you run 'heroku run bash' and get a shell into your app, does the directory exist, and what are its permissions?

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥100 set_link_state
  • ¥15 虚幻5 UE美术毛发渲染
  • ¥15 CVRP 图论 物流运输优化
  • ¥15 Tableau online 嵌入ppt失败
  • ¥100 支付宝网页转账系统不识别账号
  • ¥15 基于单片机的靶位控制系统
  • ¥15 真我手机蓝牙传输进度消息被关闭了,怎么打开?(关键词-消息通知)
  • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
  • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
  • ¥15 手机接入宽带网线,如何释放宽带全部速度