how to start a simple (temporary) webserver in current directory (with php support)

Sunday, 10. November 2013

With python 2.4 and later you can use the SimpleHTTPServer module like this

python -m SimpleHTTPServer [port]

This will start a HTTP server on port 8000 (if no port is specified) serving the files and directories which are in the current working dir.

for Python 3 use

 

python -m http.server [port]

 

If you need the web server to parse php files you should use the php webserver instead of the python webserver:

php -S 127.0.0.1:80 

Comments are closed.