I just found this awesome tip in the Apple SE:
Start a quick webserver from any directory:
python -m SimpleHTTPServer 8000
Is there a way to have this parse php scripts, or is this for html-only sites?
Server Fault is a question and answer site for system and network administrators. It only takes a minute to sign up.Sign up to join this community
I just came across this answer from StackOverflow.
Basically, python's webserver is not configured to run php files by default, but instead of trying to reconfigure python's web server, you can simply run php's web server, which works almost exactly like python's simplehttpserver, with
php [options] -S <addr>:<port> [-t docroot]
php -S 127.0.0.1:80 -t .
php -S 127.0.0.1:80
to use the current working directory.
Edit: Forgot to mention, it appears to be necessary to run this as root if you need to use port 80, but this is not necessary if you specify a higher port number like 8080. Thanks for pointing that out, Mike Houston!