Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
A local dev server for PHP.
#!/usr/bin/env python
Add to your PATH, then, from whatever directory is the root
of your PHP application, just run:
You can optionally specify a port number as an argument. By default,
port 8000 is used:
$ 8000 uses wphp and so has the same restrictions, including no
current support for mod_rewrite. Other than that, it mostly works.
import os
import sys
from paste import httpserver
from wphp import PHPApp
application = PHPApp(os.getcwd())
if len(sys.argv) > 1:
port = sys.argv[1]
port = 8000
httpserver.serve(application, host='', port=port,
except KeyboardInterrupt:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.