导航

window nginx php ci框架环境搭建

Posted on 2019-11-05 22:50  gaogaolater  阅读(294)  评论(0)    收藏  举报

下载nginx

后修改配置文件:

        location / {
            #try_files $uri $uri/ /index.php?$query_string;
            root           C:\Software\server\app;
            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:\Software\server\app;
           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:\Software\server\nginx
nginx.exe

  start-php.bat

@echo off
taskkill /F /IM php-cgi.exe > nul
echo Starting PHP FastCGI...
C:\Software\server\php\php-cgi.exe -b 127.0.0.1:9000 -c C:\Software\server\php\php.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