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 th开发者_开发问答ings 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.
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.
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.
精彩评论