Windows 下配置 Nginx PHP
2016-07-26 14:56
363 查看
自己记录一下,备忘
下载Nginx for Windows
打开网址
http://nginx.org/en/download.html
其中 nginx/Windows-1.10.1 是直接下载编译好的Windows版本的二进制程序
下载PHP for Windows
http://windows.php.net/download
我下载的是 PHP5, 版本是 PHP 5.6 (5.6.24) VC11 x86 Non Thread Safe (2016-Jul-21 19:18:58)
解压到本地某个目录
修改 Nginx 配置 /conf/nginx.conf 文件
1. 文档位置
location /{
root html # 是指相对目录 html 这个文件夹
index index.html index.htm index.php;} # 默认首页
2. php支持
location ~ .php{
root html;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAMEdocument_root$fastcgi_script_name;
include fastcgi_params;
}
PHP 配置略…
启动命令:
先启动 php-cgi
E:\Software\nginx-1.10.1\fast-cgi\php-5.6.24-nts-Win32-VC11-x86>php-cgi.exe -b 1
27.0.0.1:9000 -c E:\Software\nginx-1.10.1\fast-cgi\php-5.6.24-nts-Win32-VC11-x86
\php.ini
再启动 nginx
E:\Software\nginx-1.10.1>nginx.exe
关闭
先关 nginx
taskkill /F /IM nginx.exe > nul
再关 php-cgi
taskkill /F /IM php-cgi.exe > nul
下载Nginx for Windows
打开网址
http://nginx.org/en/download.html
其中 nginx/Windows-1.10.1 是直接下载编译好的Windows版本的二进制程序
下载PHP for Windows
http://windows.php.net/download
我下载的是 PHP5, 版本是 PHP 5.6 (5.6.24) VC11 x86 Non Thread Safe (2016-Jul-21 19:18:58)
解压到本地某个目录
修改 Nginx 配置 /conf/nginx.conf 文件
1. 文档位置
location /{
root html # 是指相对目录 html 这个文件夹
index index.html index.htm index.php;} # 默认首页
2. php支持
location ~ .php{
root html;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAMEdocument_root$fastcgi_script_name;
include fastcgi_params;
}
PHP 配置略…
启动命令:
先启动 php-cgi
E:\Software\nginx-1.10.1\fast-cgi\php-5.6.24-nts-Win32-VC11-x86>php-cgi.exe -b 1
27.0.0.1:9000 -c E:\Software\nginx-1.10.1\fast-cgi\php-5.6.24-nts-Win32-VC11-x86
\php.ini
再启动 nginx
E:\Software\nginx-1.10.1>nginx.exe
关闭
先关 nginx
taskkill /F /IM nginx.exe > nul
再关 php-cgi
taskkill /F /IM php-cgi.exe > nul
相关文章推荐
- 一个关于if else容易迷惑的问题
- nginx代理指定目录
- PHP5.2.*防止Hash冲突拒绝服务攻击的Patch
- 深入理解PHP之匿名函数
- 访问Nginx发生SSL connection error的一种情况
- 如何重装TCP/IP协议
- JSP/PHP基于Ajax的分页功能实现
- 关于PHP通过PDO用中文条件查询MySQL的问题。
- Nginx+Naxsi部署专业级Web应用防火墙
- 什么是设计模式
- Windows 8 官方高清壁纸欣赏与下载
- 谁是桌面王者?Win PK Linux三大镇山之宝
- 对《大家都在点赞 Windows Terminal,我决定给你泼一盆冷水》一文的商榷
- CentOS 6.2实战部署Nginx+MySQL+PHP
- Windows Clang开发环境备忘
- 从Windows系统下访问Linux分区相关软件