码迷,mamicode.com
首页 > Web开发 > 详细

PHP5.4+自带用于开发的服务器

时间:2015-02-03 19:10:02      阅读:214      评论:0      收藏:0      [点我收藏+]

标签:

Using the Built-in PHP CLI Server

Alternatively — if you are using PHP 5.4 or above — you can use the built-in CLI server (cli-server). To do this, you just start the server in the root directory:

1
php -S 0.0.0.0:8080 -t public/ public/index.php

This will make the website available on port 8080 on all network interfaces, using public/index.php to handle routing. This means the site is accessible via http://localhost:8080 or http://<your-local-IP>:8080.

If you’ve done it right, you should see the same result as with Apache above.

To test that your routing is working, navigate to http://localhost:8080/1234 and you should see the same error page as with Apache above.

PHP5.4+自带用于开发的服务器

标签:

原文地址:http://www.cnblogs.com/flytome/p/4270381.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!