Python SimpleHTTPServer with PHP
Question:
Answers:
The reason why the Python Webserver sends your PHP files to the brower is likely because it is not configured or able to handle PHP files. See https://serverfault.com/questions/338394/how-to-run-php-with-simplehttpserver
PHP 5.4 has a built-in webserver. You can call it from the command line like this:
php [options] -S <addr>:<port> [-t docroot]
Example
C:UsersGordon>php -S 127.0.0.1:80 -t .
PHP 5.4.0 Development Server started at Sun Sep 02 14:20:28 2012
Listening on 127.0.0.1:80
Document root is C:UsersGordon
Press Ctrl-C to quit.
Note that if you omit -t
PHP will use the current working directory.
The reason why the Python Webserver sends your PHP files to the brower is likely because it is not configured or able to handle PHP files. See https://serverfault.com/questions/338394/how-to-run-php-with-simplehttpserver
PHP 5.4 has a built-in webserver. You can call it from the command line like this:
php [options] -S <addr>:<port> [-t docroot]
Example
C:UsersGordon>php -S 127.0.0.1:80 -t .
PHP 5.4.0 Development Server started at Sun Sep 02 14:20:28 2012
Listening on 127.0.0.1:80
Document root is C:UsersGordon
Press Ctrl-C to quit.
Note that if you omit -t
PHP will use the current working directory.