Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there any harm in running PHP and Ruby on the same server?

I am an experienced PHP programmer, but I have been looking into Ruby lately, and it seems there are some neat features that I have been missing out on. I want to use PHP for all my important things, but then throw in a nice dash of Ruby on Rails when it makes things convenient (for, let's say, working with a Cassandra database, something not easily accomplished with PHP.)

Is there any harm in running PHP and Ruby simultaneously on one Apache setup? I would like to use some of the finer features of Rails, but I'm addicting to PHP and cannot give it up.

like image 462
Nick Anderegg Avatar asked Jan 31 '11 22:01

Nick Anderegg


People also ask

Is Ruby on Rails better than PHP?

While it's clear that Ruby is a more difficult programming language to master, in many ways, it is a more robust language that is better suited for creating business applications. PHP was created specifically for the web, but Ruby on Rails offers much more.

Does Ruby on Rails use PHP?

Both PHP and Ruby on Rails have their own strengths and weaknesses. Developers need to speed up the development of the web apps they produce, and they need a strong PHP framework to do it. Ruby on Rails developers code in Ruby, so Ruby on Rails vs PHP is not a straightforward comparison.


2 Answers

As long as your apps are well behaved there will be no problems.

Ruby, and/or Rails, just like PHP, could consume all available resources, but that's our own fault when it happens. Since you're experienced with PHP, I'm sure you're already aware of what sort of behaviors could bog down a server.

I say go for it.

Having written PHP code, along with using Ruby's Sinatra, Padrino and Rails for web front-ends, I'll also say "watchout". Ruby + Sinatra or Padrino + HAML can really seduce you to the Ruby-side.

like image 94
the Tin Man Avatar answered Oct 06 '22 18:10

the Tin Man


These kinds of setups make the universe implode, so use with care. But on a serious note, you will have no trouble running them. As The Tin Man said, make sure you have enough resources. Even the best written applications with ROR will burn through resources. A poorly written PHP application will take down whole server. My rule of thumb: CPUs and RAM are cheap, but that doesn't mean your applications should be big and unruly.

like image 29
Serge Stepanov Avatar answered Oct 06 '22 19:10

Serge Stepanov