Python SimpleHTTPServer with PHP

I used python -m SimpleHTTPServer , but the PHP files are not executing, but just loading.

I heard about WPHP in an old post. But I do not know how to use it. How can I work with him?

+43
python php
Sep 02
source share
1 answer

The reason the Python web server sends your PHP files to the browser is most likely because it is not configured or able to process PHP files. See https://serverfault.com/questions/338394/how-to-run-php-with-simplehttpserver

PHP 5.4 has a built-in web server . You can call it from the command line as follows:

php [options] -S <addr>:<port> [-t docroot] 

Example

 C:\Users\Gordon>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:\Users\Gordon Press Ctrl-C to quit. 

Note that if you omit -t , PHP will use the current working directory.

+105
Sep 02 '12 at 12:20
source
โ€” -



All Articles