window nginx php ci框架环境搭建

下载nginx

后修改配置文件:

        location / {
            #try_files $uri $uri/ /index.php?$query_string;
            root           C:Softwareserverapp;
            index   index.php index.html index.htm;
            if (-f $request_filename/index.php) {
                rewrite (.*) $1/index.php
                break;
            }
            if (!-e $request_filename) {
                rewrite (.*) /index.php;
            }
        }


        location ~ .php($|/) {
           root           C:Softwareserverapp;
           fastcgi_pass   127.0.0.1:9000;
           fastcgi_index  index.php;
           fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
           fastcgi_param  PATH_INFO $fastcgi_path_info;
           fastcgi_split_path_info ^(.+.php)(.*)$;
           include        fastcgi_params;
        }

下载php

下载CI框架

编写执行脚本

  start-nginx.bat

@echo off
taskkill /F /IM nginx.exe > nul
echo Starting nginx...
cd C:Softwareserver
ginx
nginx.exe

  start-php.bat

@echo off
taskkill /F /IM php-cgi.exe > nul
echo Starting PHP FastCGI...
C:Softwareserverphpphp-cgi.exe -b 127.0.0.1:9000 -c C:Softwareserverphpphp.ini

  stop.bat

@echo off
echo Stopping nginx...
taskkill /F /IM nginx.exe > nul
echo Stopping PHP FastCGI...
taskkill /F /IM php-cgi.exe > nul
exit

  

原文地址:https://www.cnblogs.com/gaogaolater/p/11802320.html