Win7整合WNMP(Win7+Nginx+PHP+MySQL)

分享知识 传递快乐

 

1、下载PHP所需要用环境

下面这此地址都是管网下载地址:

nginx:http://nginx.org/

php:https://www.php.net/downloads.php

mariadb:https://downloads.mariadb.org/

 

2、配置

下载完成后,了为方便文件管理推荐把要使用的环境放在同一个目录下。

nginx配置

nginx 默认项目目录在当前根目录下的html目录。nginx主要项目指向目录、访问域名或访问地址、打开 location ~ \.php$ 下的注释并修改 fastcgi_param 值即可。参考配置:

http {
    include       mime.types;
	default_type  application/octet-stream;
    log_format  main  '$remote_addr - $remote_user [$time_local] "$request" $status $body_bytes_sent "$http_referer" "$http_user_agent" "$http_x_forwarded_for"';
    access_log  logs/access.log  main;
    sendfile        on;
    keepalive_timeout  65;
	
    server {
        listen       8080;
        server_name  localhost;
		charset UTF-8;
		access_log  logs/host.access.log  main;
		
        location / {
            root   D:/WnmpServer/workspace;
            index  index.html index.htm;
        }

        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            root   html;
        }
		
        location ~ \.php$ {
            root           D:/WnmpServer/workspace;
            fastcgi_pass   127.0.0.1:9000;
            fastcgi_index  index.php;
            fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
		    include        fastcgi_params;
        }
		
    }

}

php配置

打开php目录,找到 php.ini-development 并把重名命为 php.ini,打开分别修改以下几种值,如果是注释的请打开注释。以下是配置个人使用的配置信息,仅供参考。

此配置是本人的项目目录,请根据个人使用情况而定
open_basedir = D:/WnmpServer/workspace

extension_dir = "./ext"

enable_dl = On

cgi.force_redirect = 0

cgi.fix_pathinfo=1

fastcgi.impersonate = 1

cgi.rfc2616_headers = 1

extension=curl

extension=mbstring

extension=mysqli

extension=pd

mariadb配置

mariadb 没什么配置信息,主要是创建数据库并设置数据库密码即可。在这里就不太多介绍,详情请参考《MariaDB安装ZIP软件包

 

3、配置启动方式

启动方式有很多种,可以根据个有爱好而写,而本人喜欢用bat来启动服务。如有兴趣请参考《windowns下如何使用bat命令启动程序

 

 

 

 

 

 

 

 

———————————
如有不足请留言指正
相互学习,共同进步

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

旷野历程

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值