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条)

报告相同问题?

悬赏问题

  • ¥15 一道python难题2
  • ¥15 一道python难题
  • ¥15 用matlab 设计一个不动点迭代法求解非线性方程组的代码
  • ¥15 牛顿斯科特系数表表示
  • ¥15 arduino 步进电机
  • ¥20 程序进入HardFault_Handler
  • ¥15 oracle集群安装出bug
  • ¥15 关于#python#的问题:自动化测试
  • ¥20 问题请教!vue项目关于Nginx配置nonce安全策略的问题
  • ¥15 教务系统账号被盗号如何追溯设备