I love rails much better than php.
I do, too.
(I'm not a php expert, though.)
I'm not either.
However, when I use rails with apache, it's painful.
(I use Dreamhost as my web hosting server, by the way)
Sorry to hear that. I was involved in a project that tried to deploy to DreamHost. I had nothing but problems. And it was very slow. Even SSHing to the command line was like frozen syrup. I would advise searching for a host that is dedicated to Rails deployments, not one that just tacks it on.
I know that I can't compare rails with php because rails is a framework
and php is a language.
Let's just think that rails is a ruby with some libraries.
Then it's comparison between php and ruby, right?
Right, you'd want to compare PHP to Ruby. It's a matter of preference. I like Ruby. I remember when I was making a decision between Python and Ruby, I read an article that offered a very sound piece of advice. It went something like this: both Python and Ruby are great and you can accomplish whatever you need to in them, but they feel different. Try both out and go with the one that "feels better" to you. I did that, and I like the feel of Ruby. I also like the feel of Rails.
Why is rails so difficult to deploy while php is easy?
Can we make rails as easy as php for apache, or is it fundamentally
I don't know any of the details, but Ruby 1.9 is just around the corner. I read somewhere that performance is at least 2.5 times better. I've also read somewhere about a different Ruby VM that will hopefully make it faster. While none of this is reality today, it does bring some hope. Until then, you do have options. I use LiteSpeed. Even though it's not open source, the standard version (32 bit, one CPU) is free. It's pretty snappy. They wrote their own Ruby API and it's supposed to be the fastest way to run Rails apps. They also support PHP, and _claim_ it can be 5 times faster than mod_php. I have not done any benchmarks, so I can't say if their claims are true. This is what I do know from my own personal experience: It's easy and it seems to perform well. I like it. www.litespeedtech.com. [I'm not affiliated with them in any way!]
Before I switched to LiteSpeed, I used Mongrel behind Apache. And while this works fine, there are some aspects of it that I don't like. You have to run a Mongrel process listening on a dedicated port. So if you have a cluster of three Mongrels, they are listening on three ports. When you have a lot of apps on your server, you have to remember which ports are taken. It can become a headache quickly. With LiteSpeed, you can have multiple listeners if you want, or you can have just one (in which case it works basically like Apache and a mod). Also, each of those three Mongrel processes are running a Ruby process and taking up RAM, the amount depends on the size of your application. I've read that a decent sized application can occupy 40M, but again, I don't know if that's true. I've not yet bothered to check as I'm still in development and my server is a sandbox. And to be fair, I don't know exactly how LiteSpeed manages memory. The configuration for LiteSpeed is also a lot easier than Apache/Mongrel as well. I don't have to futz with configuration files. LiteSpeed comes with a template preconfigured for Rails apps, so adding a new app is as easy as a couple of clicks and filling in three values.
Your mileage may vary. I used to think that I liked flexibility. I have come to realize that I actually prefer ease and productivity. That's why I use a Mac, and that's why I like Rails.
This is not a rant but pure curiosity.
Haven't you ever heard the saying that "curiosity killed the cat"?