本文简要先容了windows+nginx1.12+mysql5.6+php7整套环境的搭建支配,此方案安装简介,十分易用,并且便于掩护,非常适用于手头目前没有linux环境想跑php项目或测试开拓环境的同学们。

文件目录构造

目录构造

start_nginx.bat为开启nginx的脚本;

visualnmpphp7WNMP一键安排计划 Python

start_php_fpm.bat为开启php-fpm的脚本;

start_mysql.bat为开启mysql做事的脚本;

start.bat为开启上述所有进程的脚本;

stop.bat为关闭所有进程的脚本。

文件地址:

http://www.jishux.com/plus/view-625391-1.html

大略利用手册

Author Salamander1. 把nginx,mysql,php压缩包解压,并命名为nginx,mysql,php7(标识一下新版本而已),以下配置文件用utf-8修正(sublime即可)2. php目录中把php.ini-development(或者php.ini-production)改为php.ini,修正extension_dir配置,把稳去掉分号(;)分号表示注释,其余把一些扩展也加载进来(去掉前面分号即可)extension=php_bz2.dllextension=php_curl.dllextension=php_fileinfo.dllextension=php_ftp.dllextension=php_gd2.dllextension=php_gettext.dll; Directory in which the loadable extensions (modules) reside.; http://php.net/extension-dir; extension_dir = \公众./\"大众; On windows:extension_dir = \"大众D:/nmp/php7/ext\"大众启动php-cgi可以双击start_php_fpm.bat即可3.进入nginx中conf目录,打开nginx.conf文件找到server段(配置localhost虚拟主机) server { listen 80; server_name localhost; root D:/web_root; index index.php index.html index.htm; #charset koi8-r; #access_log logs/host.access.log main; #error_page 404 /404.html; # redirect server error pages to the static page /50x.html # error_page 500 502 503 504 /50x.html; location = /50x.html { root html; } # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000 # location ~ .php$ { fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; } }这个server的根目录为D盘下web_root,index第一个为index.php你须要D盘新建web_root文件夹,再在web_root中新建文件index.php,写入<?phpecho \"大众hello salamander\"大众; // 为了测试下nginx和php启动nginx可以双击start_nginx.bat即可4.mysql目录中放入my.ini文件,内容为[client]port=3306default-character-set=utf8[mysqld]port=3306innodb_buffer_pool_size = 512Mcharacter_set_server=utf8server_id=784basedir=D:/nmp/mysql#解压目录datadir=D:/nmp/mysql/data#解压目录下data目录max_allowed_packet = 10Mtable_open_cache = 256sort_buffer_size = 1Mread_buffer_size = 1Mread_rnd_buffer_size = 4Mmyisam_sort_buffer_size = 64Mthread_cache_size = 8log-bin=mysql-binsql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES启动mysql可以双击start_mysql.bat即可5. 关闭所有进程,双击stop.bat即可,启动所有进程,双击start.bat