windows下配置nginx1.9.x+php7开发环境
星期四, 2016-02-04 | Author: Lee | php | 3,956 views
还是跑不掉在windows下配置对应的开发环境,准备:
1.下载对应的软件
nginx-1.9.10/Windows-1.9.10
PHP 7.0 (7.0.3)/php-7.0.3-nts-Win32-VC14-x86.zip
2.安装配置nginx和php
分别解压到 D:/web/nginx-1.9.10/ 和D:/web/php7/
修改php.ini-recommended文件为php.ini
打开 一堆扩展尽量打开这里示例2个
1 2 3 | extension_dir = "D:/web/php7/ext" extension=php_mysqli.dll cgi.fix_pathinfo=1 ##这个启用cgi核心关键 |
nginx.cnf 打开php支持 同时修改fastcgi_param 参数由/scripts$fastcgi_script_name; 修改为$document_root$fastcgi_script_name;
1 2 3 4 5 6 7 8 9 | # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000 # location ~ \.php$ { root D:/web/www; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; } |
3.编辑php的脚本 (phpinfo.php)
<?php phpinfo(); ?> |
4.启动和关闭的脚本文件
启动脚本文件 start_nginx.bat
1 2 3 4 5 6 7 8 9 10 | @echo off echo starting nginx... D: cd D:/web/nginx-1.9.10/ start nginx echo starting PHP FastCGI... D: cd D:/web/php7/ php-cgi.exe -b 127.0.0.1:9000 -c D:/web/php7/php.ini exit |
关闭脚本文件 stop_nginx.bat
1 2 3 4 5 6 | @echo off echo Stopping nginx... taskkill /F /IM nginx.exe > nul echo Stopping PHP FastCGI... taskkill /F /IM php-cgi.exe > nul exit |
搞定配置
文章作者: Lee
本文地址: https://www.pomelolee.com/1539.html
除非注明,Pomelo Lee文章均为原创,转载请以链接形式标明本文地址
No comments yet.
Leave a comment
Search
相关文章
热门文章
最新文章
文章分类
- ajax (10)
- algorithm-learn (3)
- Android (6)
- as (3)
- computer (85)
- Database (30)
- disucz (4)
- enterprise (1)
- erlang (2)
- flash (5)
- golang (3)
- html5 (18)
- ios (4)
- JAVA-and-J2EE (186)
- linux (143)
- mac (10)
- movie-music (11)
- pagemaker (36)
- php (50)
- spring-boot (2)
- Synology群晖 (2)
- Uncategorized (6)
- unity (1)
- webgame (15)
- wordpress (33)
- work-other (2)
- 低代码 (1)
- 体味生活 (40)
- 前端 (21)
- 大数据 (8)
- 游戏开发 (9)
- 爱上海 (19)
- 读书 (4)
- 软件 (3)