i.e to replace Apache with a PHP application that sent back html files when http requests for .php files are sent?
How practical is this?
i.e to replace Apache with a PHP application that sent back html files when http requests for .php files are sent?
How practical is this?
Apart from Nanoweb, there is also a standard PEAR component to build standalone applications with a built-in webserver:
http://pear.php.net/package/HTTP_Server
Likewise the upcoming PHP 5.4 release is likely to include an internal mini webserver which facilitates simple file serving. https://wiki.php.net/rfc/builtinwebserver
Why reinvent the wheel? Apache or any other web server has had a lot of work put into it by a lot of skilled people to be stable and to do everything you wanted it to do.
It's already been done but if you want to know how practical it is, then i suggest you install and test with Apache bench to see the results:
http://nanoweb.si.kz/
Just FYI, PHP 5.4 just released with in-built webserver. Now you can run a local server with very simple commands like -
And you'll see the requests and responses like this -