if you want a language that can interface with devices or build an OS depend standalone softwares, then Python is a good option. but when it comes to web scripting, PHP has a upper hand because of the vast,deeper understanding and knowledge base.
I think the differences can be boiled down to these points:
PHP was ment to be used for the web. It is more or less a templating language on steroids while Python is a general purpose scripting language. You can build non-web applications with Python (The code editor Sublime Text 2 for example, even Battlefield 2 used Python for a lot of stuff as I’ve heard and Google is using it quite heavily). This is nearly impossible using PHP.
PHP is ment to react to a request, handle it and serve a response (a web request scenario). It was not created to build long running scripts which is why it is known to be less efficient when used in that context (memory leakage etc.). But that also makes it very scalable.
If you need realtime communication (server push like in a chat etc.) you would need to add something like NodeJs to your app (or use long polling if traffic is small). There is no production ready PHP version of Python’s Twisted framework for solving that at the moment (the closest being React https://github.com/reactphp/react).
PHP has changed a lot the last couple of years. It has become a very solid object-oriented programming language. If you hear people ranting about it then it is probably because they’re referring to yesterday’s PHP. Yes, the API is inconsistent but hey: One can live with that.
PHP developers are cheaper
PHP is easier to start with
PHP is very wide spread
And which one is better? Another question: Which language is better: German or French? It totally depends on your needs
@Coksnuss: Thanks. Always thought it is pure Python. But that would explain its speed then
@samdark: Let me correct that: Its MAIN purpose is/was the typical request/response scenario and you might very well be able to write your own web server or whatsoever in it To complete our collection of cool PHP projects: Ratchet - a PHP websocket library http://socketo.me/
@jacmoe: Thanks for your comments but I wanted to know about any material differences between Django vs Yii. Does one platform lend itself more to a type of project.
E.g. If you were going to be develop an ERP SaaS vs Desktop Client vs Server.
Or maybe an online website scrapper?
Since the growth of PHP and Python as well as Django and Yii (esp 2.0), it seems (at least to a very non-technical person), that the decision will most be based on other factors like availability of developers etc.