2012-10-26 02:39
浏览 94

Ruby on Rails + PHP | 如何在同一个Web服务器上配对PHP和Ruby?

Is it possible to pair PHP and Ruby on Rails on the same server? Although I'd be using RoR More, I'd still like to have PHP, is this possible? And are there any major drawbacks?

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

是否可以在同一台服务器上配对PHP和Ruby on Rails? 虽然我会使用RoR More,但我仍然想要PHP,这可能吗? 是否有任何重大缺点?

  • 写回答
  • 关注问题
  • 收藏
  • 邀请回答

2条回答 默认 最新

  • dtf24224 2012-10-26 02:50

    Yes, it is definitely possible. You can enable / set up both mod_php and mod_passenger. It will depend on your OS how to do this. Basically, you need to enable both modules, then have separate virtual hosts: one for PHP and one for Ruby.

    If you let me know your OS or more about what you want to achieve I can make this answer more detailed.

    The drawback is increased memory usage, and possibly more complex security needs by enabling PHP. But it's not a huge drawback.

    打赏 评论
  • duansha8115 2012-10-26 04:56

    This is definitely possible.

    There are many ways to go about it. One way is to install both PHP and Passenger modules in Apache and route requests through Apache.

    Another method, and the one I personally use to handle PHP and Rails on the same server, is to setup nginx in front of your PHP / Rails server mechanism of choice and have nginx rewrite requests.

    Cookie (and sessions) can be shared between PHP and Rails to make the experience smooth for your users.

    打赏 评论

相关推荐 更多相似问题