PHP for sites. Python for almost any other, such as command line tools, long scripts, daemons, etc. If you are writing a PHP script and you are accessing functions in extixstix, shared memory, or other low-level materials, then this is usually a sign that Python is better suited. It's not that PHP cannot do this, but Python just does it better and is less buggy.
, , Python. PHP , . , Python (, STDIN, STDOUT STDERR. PHP posix_dup2()). , Python : -)
, PHP , - (, MVC, CakePHP).
Python , , , Python C. , Python , PHP (OpenGL, ..). , , Python .