windows7中配置nginx php环境变量_windows7中配置Nginx+php环境教程

时间:2017-09-10  来源:Windows7  阅读:

一、准备工作:

OS:Windows7 SP1

Nginx: nginx-1.3.5

php:php-5.4.6

二、解压php-5.4.6-Win32-VC9-x86.zip到D:php,将其中的php.ini-production改成php.ini。

三、解压nginx-1.3.5.zip到D:nginx,编辑D:nginxconfnginx.conf文件:

        location / {
            root   html;
            index  index.html index.htm index.php; #添加PHP首页
        }

  #取消以下注释并修改:

        location ~ .php$ {
            root           html;
            fastcgi_pass   127.0.0.1:9000;
            fastcgi_index  index.php;

       # html表示网站目录,须和root中的保持一致
            fastcgi_param  SCRIPT_FILENAME  html$fastcgi_script_name;
            include        fastcgi_params;
        }

四、在D:nginx中添加php-cgi.cmd文件并写入内容:

"D:phpphp-cgi.exe" -b 127.0.0.1:9000 -c "D:phpphp.ini"

五、在D:nginxhtml文件夹中添加phpinfo文件index.php并写入内容:

1 2     phpinfo();
3 ?>六、运行D:nginxphp-cgi.cmd和D:nginxnginx.exe,然后打开:http://localhost/index.php,有没有看到熟悉的phpinfo页面!

七、nginx基本命令:

  start nginx:启动nginx

  nginx -s stop:停止nginx

  nginx -s quit:退出nginx

 

windows7中配置nginx php环境变量_windows7中配置Nginx+php环境教程

http://m.bbyears.com/caozuoxitong/35472.html

推荐访问:
相关阅读 猜你喜欢
本类排行 本类最新