Necro.
Necro.

Reputation: 987

Ruby on Rails + PHP | How To Pair PHP AND Ruby On The Same Webserver?

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?

Upvotes: 3

Views: 2242

Answers (2)

Jeevan
Jeevan

Reputation: 73

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.

Upvotes: 1

Ivan -Oats- Storck
Ivan -Oats- Storck

Reputation: 4326

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.

Upvotes: 3

Related Questions