上一个主题< Cherokee 安装说明(Cherokee Installation Notes) 下一个主题教程 1:让我们通过例子来学习(Tutorial 1: Let’s learn by example) > 本页 |
使用 PHP 内置 web 服务器(Using PHP Built-in webserver)¶As of PHP 5.4.0, you can use PHP’s on built-in web server for development. To start the server type: php -S localhost:8000 -t /web_root
If you want to rewrite the URIs to the index.php file use the following router file (.htrouter.php): <?php
if (!file_exists(__DIR__ . '/' . $_SERVER['REQUEST_URI'])) {
$_GET['_url'] = $_SERVER['REQUEST_URI'];
}
return false;
and then start the server with: php -S localhost:8000 -t /web_root .htrouter.php
Then point your browser to http://localhost:8000/ to check if everything is working. |