If you learn PHP:
* You'll be able to see results running in your Web browser a lot quicker
* Your knowledge will be really relevant if you're looking to work on slightly older, more established Web sites like Facebook or Yahoo!, but
* You probably won't learn very good programming practices on your own - PHP has been pretty notorious for this, but maybe this has changed with PHP5, I haven't been keeping up.
If you learn Ruby:
* First you'll have to learn the language, and then you'll basically have to learn a framework like Sinatra or Rails before you'll be able to do awesome Web things
* Your knowledge will be really relevant to most startup-style Web sites begun since 2005 or so (e.g. Yelp, which is written in Python, which is basically sort of like a sister language to Ruby, give or take)
* You'll be much more likely to learn a lot of really good programming practices as you go that will serve you throughout your career.
Having worked with both PHP and Ruby, I'd recommend Ruby, because I think it's easier to learn, it's more fun, and it's a better investment; I'm pretty sure most HNers would agree if given the choice between those two languages, but your sample of respondents is probably pretty biased :)
Googling for help with errors in PHP would be easier I imagine, seeing as more people know PHP. Also, there are a lot of existing PHP scripts that I could build off of.
Those are my concerns.
PHP has been more dominant in the Web world for a longer period of time, that much is definitely certain, and there's a lot of resources out there already. I think this Google Trends chart captures my impression of the relationship between the two languages, though: http://www.google.com/trends?q=php%2C+ruby&ctab=0&ge...
In addition, although you're definitely right in that there must be much more PHP documentation out there, you're not going to have much difficulty Googling for Ruby errors either - just because there will be fewer results doesn't at all mean that there won't be any. Just like in any other programming language mainstream enough to be considered a good language to learn on, any problem you have in that language will have already been experienced by someone else, and there'll almost definitely be an easily found Google result that'll solve that problem.
If you're really on a quest to create web apps and you'd like to invest in knowledge that'll help you and your webapps grow, I'd really strongly recommend learning Ruby (or Python) over PHP.
edit: on closer examination of that Google Trends chart, it looks like a good chunk of the Ruby results are from non-programming-related hits, but I'd still be willing to bet that the overall trend is the same.
I'm a lowly web designer with many ideas for web apps that I'd love to implement/see implemented. Thanks again!
Also, for a well-worded counter-argument to one of my comments, see rick888's post above ( http://news.ycombinator.com/item?id=1163355 ).
Many newer sites are using PHP as well. PHP is used on established sites, but that just means that it's a proven concept. I also see many more jobs for php developers than Ruby (I have seen a few startups using ruby).
"You probably won't learn very good programming practices on your own - PHP has been pretty notorious for this, but maybe this has changed with PHP5, I haven't been keeping up."
I suppose this is true. But I think you can pickup good programming practices in any language.
Another reason to learn php is because it uses a C-style syntax, which will make it much easier to transition to other languages like c/c++/javascript/c#/Java.
Ruby uses a syntax all its own that you can pretty much only use in Ruby.
I also don't feel people should be learning a programming language through frameworks. It's like learning how to add and subtract using a calculator.
What beginners need to learn is programming concepts that they can use in any language.
My enjoyment of programming in Ruby and Python may have something to do with them both being scripting languages, and having easily-accessible REPLs (for the uninitiated: Read-Eval-Print-Loops, like irb, a program I mention and show example output from in my post). In addition, scripting languages just... feel easier. If you've got Python installed on your computer, go ahead and pop up a terminal if you'd like to follow along:
[jrheard@jrheard:~]$ python
>>> import webbrowser
>>> webbrowser.open_new('http://google.com')
True
If you weren't following along: Firefox just opened a new tab with Google in it! Isn't that awesome? How many lines would that be in C? >>> import urllib
>>> goog = urllib.urlopen('http://google.com')
>>> page_source = goog.read()
>>> len(page_source)
6917
>>> page_source[:27]
'<!doctype html><html><head>'
The real power of Python and Ruby is that I can do awesome stuff without even thinking about it. At all. At least half the time I have a problem, the most I have to do is one Google search to find the built-in library I need.The point I'm trying to make is that, syntax aside, I feel like Python and Ruby just get out of my way most of the time, so I can focus on solving problems and learning programming concepts I can learn in any language.
Jeff Atwood sums up a lot of my sentiments in his post "A Scripter At Heart", which you can read at http://www.codinghorror.com/blog/2009/01/a-scripter-at-heart... .
You may have other options, and hopefully someone can correct my misconceptions and fill in the gaps where I didn't mention a good option.
In any case: Ruby (and Python too, as it turns out: http://www.python.org/download/windows/ ) offer installers for Windows and can get repetitive shit done, and are pretty fun to write, so I'd recommend you take a look at either language. I use Python myself.