临时测试php又不想搭建vhost就用它把 php内置的web服务器
2017-04-19 15:45
519 查看
URI请求会被发送到PHP所在的的工作目录(Working Directory)进行处理,除非你使用了-t参数来自定义不同的目录。如果请求未指定执行哪个PHP文件,则默认执行目录内的index.php 或者 index.html。如果这两个文件都不存在,服务器会返回404错误。当你在命令行启动这个Web Server时,如果指定了一个PHP文件,则这个文件会作为一个“路由”脚本,意味着每次请求都会先执行这个脚本。如果这个脚本返回
FALSE,那么直接返回请求的文件(例如请求静态文件不作任何处理)。否则会把输出返回到浏览器。Example #1 启动Web服务器
$ cd ~/public_html $ php -S localhost:8000终端窗口会显示:
PHP 5.4.0 Development Server started at Thu Jul 21 10:43:28 2011 Listening on localhost:8000 Document root is /home/me/public_html Press Ctrl-C to quit
相关文章推荐
- Nginx 0.7.x + PHP 5.2.10(FastCGI)搭建支持高并发量的Web服务器
- Nginx 0.7.x + PHP 5.2.9(FastCGI)搭建胜过Apache十倍的Web服务器
- 用 Jexus ASP.NET WEB服务器搭建 PHP 网站的具体方法
- Nginx 0.8.x + PHP 5.2.13(FastCGI)搭建胜过Apache十倍的Web服务器
- Nginx 0.7.x + PHP 5.2.6(FastCGI)搭建胜过Apache十倍的Web服务器
- linux下apache+php(fastcgi)web服务器的搭建
- Nginx 0.8.x + PHP 5.2.10(FastCGI)搭建胜过Apache十倍的Web服务器
- Nginx + PhP 搭建 超性能 WEB 服务器
- Nginx 0.8.x + PHP 5.2.13(FastCGI)搭建胜过Apache十倍的Web服务器
- 搭建高性能Web服务器Nginx,10倍于Apache---Nginx+Php(FastCgi模式)
- 本地PHP搭建简单测试服务器及VBscript接口测试脚本
- Nginx 0.7.x + PHP 5.2.9(FastCGI)搭建胜过Apache十倍的Web服务器
- Nginx+PHP(FastCGI)搭建胜过Apache 10倍的Web服务器
- 测试ApacheWeb和PHP应用程序服务器
- 搭建高性能Web服务器Nginx,10倍于Apache---Nginx+Php(FastCgi模式)
- 在Linux上搭建WEB服务器:基本概念、PHP zt
- ginx + PHP搭建可承受3万以上并发连接数,胜过Apache 10倍的Web服务器
- 使用Ubuntu搭建Web服务器(PHP)
- Linux+Apache+MySQL+PHP搭建高性能的web服务器
- CentOS+Nginx+PHP+MySQL 搭建高性能的web服务器