Currently I'm working on some PHP porjects. And it's a little bit difficult to navigate always through approximately 100 folders to the dest开发者_运维百科ination one. Also it's not very comfortable to create virtual hosts for Apache. And it would be much more comfortable to run from CLI command like "someserver start ." and then just go to the localhost:8080 in favorite web-browser and start enjoying the development process.
If you are thinking along the lines of a built-in server like Mongrel is for Ruby, then No. This doesn't exist for PHP as of PHP 5.3.6. A patch offering that is under discussion though:
CLI version of PHP will have a new command-line option -S followed by a host address (either in numeric or alphabetic) and a port number delimited by a colon, which will launch a builtin web server listening on the given address and port
php -S localhost:8000 docroot
Links:
- Alexey Zakhlestins on PHP's Webserver
- PHP Wiki Request for Comments: Built-in web server
- Webserver Patch
For a complete self contained web development setup, you can use XAMPP. To simplify things further you can then just develop out of the htdoc or www folder provided by xampp.
精彩评论