WIN10配置NGINX+PHP环境
版本
- nginx-1.11.8
- php-7.1.0-nts-Win32-VC14-x64
修改配置
- 修改php.ini
- 去掉注释cgi.fix_pathinfo=1
- 拷贝nginx目录下conf, html, logs, temp目录至E:site(不使用默认路径)
- 修改nginx.conf
- 去掉注释location ~ .php
- 修改location ~ .php->root E:/site/html;
- 修改location / ->root E:/site/html;
- 修改location / ->index index.php index.html index.htm;
- 修改location = /50x.html->root E:/site/html;
准备启动脚本
phpcgi.bat
@echo off
echo Starting PHP FastCGI…
“D:Program Filesphp-7.1.0-nts-Win32-VC14-x64php-cgi.exe” -b 127.0.0.1:9090 -c “D:Program Filesphp-7.1.0-nts-Win32-VC14-x64php.ini”
nginx.bat
@echo off
echo Starting nginx…
“D:Program Filesginx-1.11.8ginx.exe” -p “E:site”
stop.bat
echo Stopping nginx… taskkill /F /IM nginx.exe > nul echo Stopping PHP FastCGI… taskkill /F /IM php-cgi.exe > nul pause