Downloading php files from python simple http server
Yep, a simple server like Python's doesn't execute PHP. Even something like Apache wouldn't execute PHP either, unless you specifically told it to (which involves installing mod_php).
Technically, as far as the web server is concerned, everything is just a downloadable file unless you (the configurator) tell it otherwise.
SimpleHTTPServer module just serves files. To parse the php files you need one of the "big" http servers, for example apache or lighttpd, with the proper module (mod_php) or cgi to parse the php code and give you the html output of it
This may work :)
#!/usr/bin/env python
from BaseHTTPServer import HTTPServer
from CGIHTTPServer import CGIHTTPRequestHandler
serve = HTTPServer(("",8080),CGIHTTPRequestHandler)
serve.serve_forever()
php file:
#!/usr/bin/php
<? phpinfo(); ?>
dont forget to chmod +x on the php script.