开发者

php webserver equivalent of mongrel?

开发者 https://www.devze.com 2022-12-31 15:57 出处:网络
Is there a php equivalent of mongrel? I don\'t want to install Apache, just to preview a simple template开发者_开发百科.mongrel2 looks promising!This is possible starting with php 5.4:

Is there a php equivalent of mongrel? I don't want to install Apache, just to preview a simple template开发者_开发百科.


mongrel2 looks promising!


This is possible starting with php 5.4: http://php.net/manual/en/features.commandline.webserver.php

As of PHP 5.4.0, the CLI SAPI provides a built-in web server.

This web server is designed for developmental purposes only, and should not be used in production.

To run it:

$ cd ~/public_html
$ php -S localhost:8000


I know it's not the ideal solution, but if it's just one page, you can render it straight out to HTML.

php /path/to/file.php > /path/to/output.html


As I posted in the other thread - have a look at Photon (http://www.photon-project.com), it might serve your needs quite well already.

0

精彩评论

暂无评论...
验证码 换一张
取 消