A PHP built-in Web server has been proposed as a Request For Comment (RFC), which includes a patch to the PHP source code base. If the PHP maintainers decide to move forward with the proposal, we’d soon see an embedded Web server shipping with PHP CLI. Here’s how one would start and run the Web server:
php -S localhost:8000
Server is listening on localhost:8000… Press CTRL-C to quit.
[Thu Mar 3 05:42:06 2011] ::1:56258: /
[Thu Mar 3 05:42:06 2011] ::1:56259: /?=PHPE9568F34-D428-11d2-A769-00AA001ACF42
[Thu Mar 3 05:42:06 2011] ::1:56260: /?=PHPE9568F35-D428-11d2-A769-00AA001ACF42
In a way, it’s similar to how one would start the Django or web.py development server. Interesting patch…