win安装nginx php mysql_window 下安装nginx、php 、mysql过程及配置详解

下载

安装mysql安装 我安装的v6.5 百度一下就知道

nginx安装解压nginx到指定目录

win+r  打开运行输入cmd

92e5de5507aae1120be0d834042accb7.png

进入到nginx解压目录,使用start nginx.exe 安装nginx

c636425b71f0303ebfe1914cad2753ee.png安装基本就是毫秒级的安装完成后,在浏览器输入127.0.0.1会出现nginx的欢迎界面

97f90a93927f4d9bde8c0d1e452196a5.png

nginx 的常用命令

nginx.exe -s stop      //停止nginx

nginx.exe -s reload   //重新加载nginx

nginx.exe -s quit       //退出nginx

3. php安装解压安装包到指定安装目录

复制 D:\services-nmp\php\php-5.6.21 目录下的php.ini-development 并重命名为php.ini

打开php.ini 修改配置

extension_dir 修改为  extension_dir = "D:/services-nmp/php/ext/" 注意斜杠 /   (php的安装路径)

date.timezone 修改为  date.timezone = Asta/BeiJing

enable_dl (是否使dl()有效) 修改为  enable_dl = On

cgi.force_redirect = 1  修改为  cgi.force_redirect = 0

fastcgi.impersonate  修改为  fastcgi.impersonate = 1

cgi.rfc2616_headers  修改为  cgi.rfc2616_headers = 1

打开mysql 扩展 : 去掉  extension=php_mysql.dll   extension=php_mysqli.dll 前面的分号

配置 使用nginx访问php还需需要配置nginx打开nginx的安装目录下的conf 下的nginx.cof

修改 location / {

root   html;

index  index.html index.htm;

}

为  location / {

root   D:/services-nmp/nginx\nginx-1.10.0/html;

index  index.html index.htm  index.php;

}

3. 修改

# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000

#

#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;

#}

# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000

location ~ \.php$ {

root               D:/services-nmp/nginx\nginx-1.10.0/html;

fastcgi_pass   127.0.0.1:9000;

fastcgi_index  index.php;

fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;

include        fastcgi_params;

}

4、保存配置,重启nginx

验证php是否安装成功

1、执行cgi  下载RunHiddenConsole 随便一搜就有 放到php的安装目录下然后cmd在php目录下执行如下命令

f63c70797530d5a3b9e34731e34cbf13.png

2、重启nginx

3、在nginx安装目录下的html文件夹下添加新的php程序 随便写个php程序就行

phpinfo();

?>

4、在浏览器中访问127.0.0.1/1.php 出现如下界面表示成功。

a323a89bf23cd96ad577fdbe70cb90b3.png

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值