dongxichan8627
2013-10-27 21:44
浏览 66
已采纳

Symfony2:在chroot环境中生产?

As a learning exercise I used Symfony to update an existing application for a local non-profit. Development was in a Windows environment. Now that the application has been installed on their ISP's shared host I start to learn about chroot on a FastCGI server. There are errors such as this:

PHP Fatal error: Uncaught exception 'UnexpectedValueException' with message 'The stream or file "/home/projectmana/www2.projectmana.org/app/logs/prod.log" could not be opened: failed to open stream: No such file or directory' in /www2.projectmana.org/app/cache/prod/classes.php:4823

The ISP responds with:

Bad path. PHP is chrooted in /home/projectmana/.

OK. I get it that this is the problem. Web searches so far have not provided a clue as to how to proceed. (I've gained greater appreciation for Symfony wanting to avoid shared hosting.) Is there a solution that I, a relative novice and a volunteer, can implement in my code, or does the application have to find a new home?

图片转代码服务由CSDN问答提供 功能建议

作为一项学习练习,我使用Symfony为本地非营利组织更新现有应用程序。 开发是在Windows环境中进行的。 现在应用程序已安装在其ISP的共享主机上,我开始了解FastCGI服务器上的chroot。 有这样的错误:

PHP致命错误:带有 消息的未捕获异常'UnexpectedValueException''流或文件 “/ home / projectmana / www2 .projectmana.org / app / logs / prod.log“无法打开:无法打开流:没有这样的文件或目录”在 /www2.projectmana.org/app/cache/prod/classes.php :4823

ISP响应:

路径错误。 PHP在/home/projectmana/.

nn

OK中被chroot。 我明白这就是问题所在。 到目前为止,网络搜索还没有提供关于如何进行的线索。 (我对Symfony希望避免共享托管感到非常欣赏。)我是一个相对新手和志愿者可以在我的代码中实现的解决方案,还是应用程序必须找到一个新家?

  • 写回答
  • 好问题 提建议
  • 追加酬金
  • 关注问题
  • 邀请回答

2条回答 默认 最新

  • douyou7878 2013-10-28 14:14
    最佳回答

    The solution in this instance was to override the locations of the cache and logs directories according to the cookbook. This, however, by itself causes the cache:clear command to fail. The answer to that problem will have to appear in another question if I can't find it on my own.

    Update

    The other solution here cannot work because any php setting in .htaccess when Apache server is running FastCGI will cause a server error. Clearing the cache was never solved so the site was moved to a non-CGI host.

    评论
    解决 无用
    打赏 举报
查看更多回答(1条)