There's a world of difference in building a photo sharing app with XXX,XXX users vs. building a chat app with XXX,XXX users.
When you do anything that involves chat or that level of concurrency, surprises will bite you in the behind, multiple times, even if you desperately try to use as much existing software as possible.
(as anyone who's taken a look at ejabberd, thought it'll play nicely, and then load tested their code will tell you)
Frankly, PHP vs. Rails vs. Node[1] vs .Net vs Java will be the least of your troubles.
[1] I do fear that the author is going to find a nasty surprise or two for themself regarding Node's performance issues