首页 > Web开发 > 详细

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

时间:2015-02-03 19:07:23      阅读:250      评论: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
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!