WNMP环境搭建
mysql下载64位 win10(win10+Ndinx1.9.15+MySQL5.7.12+PHP5.6.21)Before:提前规划好的⽬录结构
2.安装PHP
3.配置Nginx
 常⽤Nginx命令:
start nginx      //启动服务
nginx -s stop    // 停⽌nginx
nginx -s reload  // 重新加载配置⽂件
nginx -s quit    // 退出nginx
打开nginx⽬录下conf⽂件夹⾥的f配置⽂件.
修改为如下配置:
将:
location / {
root  html;
index  index.html index.htm;
}
改为:
location / {
root  D:/WNMP/Nginx/html;
index  index.html index.htm index.php;
}
将:
#location ~ \.php$ {
#    root          html;
#    fastcgi_pass  127.0.0.1:9000;
#    fastcgi_index  index.php;
#    fastcgi_param  SCRIPT_FILENAME  /scripts$fastcgi_script_name;
#    include        fastcgi_params;
#}
改为:
location ~ \.php$ {
root          D:/WNMP/Nginx/html;
fastcgi_pass  127.0.0.1:9000;
fastcgi_index  index.php;
fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
include        fastcgi_params;
}
注意fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;⼀⾏的变化。
这样配置可使Nginx将PHP请求交给运⾏于9000端⼝PHP的fastcgi处理
4.配置PHP
5.安装配置MySQL
6.总结启动步骤
D:\WNMP\PHP& -b 127.0.0.1:9000 -c D:\WNMP\PHP\php.ini    D:\WNMP\Nginx>start nginx
管理员:>net start mysql
>mysql -u root -p
Enter password: root

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。