Python or php which language would be better for web development?
What are you developing?
(how long is a piece of string?)
That said, PHP is a very accessible language for Web Development and extremely popular among many large open-source projects like WordPress. The system has evolved it's own object-oriented methodology and is an excellent way to start learning to develop data-driven applications for the web. It's also very forgiving.
PHP is a more popular language in the web development community, currently. On the other hand, Python itself is a cleaner language that promotes better programming style and is much more popular than PHP outside the web development world.
So if you plan to do any other sort of coding (including scripting, automation, stuff every programmer needs), I'd suggest to go with Python if you only want to learn one language now. Even though PHP is more popular, Python is catching up and has great libraries and communities for web programming.
P.S. This is my personal, subjective opinion, of course. I've also added the subjective tag to your question because it belongs there.
An advantage of PHP is that really every cheap webhosting service will allow you to run your PHP scripts. If that is not an issue, I'd go with Python, as it is generally considered a "better" language, and can be used in many different situations, unlike PHP.
I agree with eliben. A lot of existing projects are done in PHP and it has become the language of the web.
However its really easy to write bad code in PHP. Python is a more natural language, also very interesting and stimulating to program in. There are also many good web frameworks that help with whatever you need in web development is. (Django, Pylons, Turbo Gears and others)
Also don't count out Ruby, Java, and .NET as alternatives depending on the need and the programmers involved. `
If those are your only two options, I'd say "whichever one you're more comfortable working in". Both languages are about equal in the web development world, IMO -- PHP's got the "web heritage" and ubiquity on it's side, while I think Python's a slightly better language overall.
Don't disregard the alternatives, though -- Ruby on Rails is by far the best web application framework I've ever used, and the Ruby language itself is beautiful. .NET and the rest of the proprietary world are apparently pretty nice in their own way, too.