1) Which one should I learn first? PHP or Python? 2) Which language has a better prospect in terms of web programming?
That being said, learn Python; if anything so you don't have to hear smarmy language snobs go on and on about how PHP is terrible.
On a deeper level, I would seriously consider taking some source code from each and pasting it into the editor of your choice. Then maximizing each one side by side and consider how staring at each one makes you think about working in it.
I know it's a bit fruity, but I like to think about it as code Ikebana. I'm only a little embarrassed to admit that I've made more than a few code decisions that way.
[Edit: I'm a smarmy language snob, so feel free to ignore this advice :D ]
A: PHP -- simply because it's so easy for people to install and run PHP apps. At this moment in time, I think almost all of the 'breakout' open source apps have becomes breakout hits in part because they're written in PHP.
You can do quite a bit in PHP. Facebook's FBML parsers are written in PHP and Flickr's home-brewed queue-based background processing system is written in PHP. Yes, PHP is difficult to stare at all day because of the $,->,=>,@, and ; (and soon /), but it's a perfectly fine language otherwise.
Python would be my choice if my web app required a lot of algorithmic work. If, for example, I was performing a lot of text analysis, I'd choose Python. They have a number of built-in operations and operators that make it easy and concise to do such things. I believe that the original Google spiders were written in Python. And there are numerous libraries for do statistics, advanced math, and such things in Python. If your web app can be built on-top-of Google's App Engine and doesn't require https (assuming you use your own domain name), then that might be a good place to start.
If you just want to learn 'something' and not do any real project, by all means, learn python. Python is a great and easy to learn language that lets you make great programs, and not only webbased ones! Python is a very well supported language, it runs on linux, mac and windows so you can use it wherever you want.
If you just want to make a website for yourself and don't want to spend too much money, I suggest you use php. If you want I am sure you can find some webhost that offers you some webspace + domain name for around 20$. Will that be a very good webhost with lots and lots of space/traffic? Probably not, but I'm pretty sure it will enough you for some time. And besides, if you find out php you're not into making websites, you can have a wordpress blog up and running in about 5min, without any php coding required.
Long answer: If you want to code web apps primarily for the forseeable future, go with PHP and a great backend framework like Code Igniter.
If you want to eventually code larger scale backend pieces, and grow into other areas of development, go with Python.
I love Python, but have a renewed loss of skepticism for PHP given how well CodeIgniter has performed for some of our major web apps. I personally feel Python doesn't feel as inherently interconnected with web concepts as PHP, so there are more complications/hurdles to get past in order to build a 100% functional/pretty web app. But you'll be much better off long-term for learning Python if you're going into sysadmin/backend/app development.
I love coding, so I learned both. Good luck!
Both work quite fine, PHP is more web-centric. Its not used so much for scripting or even some desktop apps like Python is. But if I was going to make an off the cuff assessment I'd say its better for web development just because its so huge in the space.
Now, I'm not a language zealot so I'll answer your second question a little differently. It really depends on how you define "web programming". If your goal is to hack together a few scripts for standard websites, PHP is a nice easy language that you can learn quickly. If you're more interested in web applications, python will be the better choice for you in the long run.
In the end, what's important is how comfortable you are writing code in that language. Large systems and sites have been created using both.
Personally, I like Python more for both web and general programming, having used both.