nginx-1.4.7+php-5.5.10-nts-Win32-VC11-x86+RunHiddenConsole 配置支持PHP

1.更改nginx 的nginx.conf文件    打开并找到如下内容

       location ~ \.php$ {
            root           c:/nginx/html;
            fastcgi_pass   127.0.0.1:9000;
            fastcgi_index  index.php;
            fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
            include        fastcgi_params;
        }

2.更改php中的php.ini-development 文件名为php.ini 并打开找到cgi.fix_pathinfo=1  去掉前面的' ; '

 

3.更改RunHiddenConsole中的 start.bat   stop.bat

 

start.bat

----------------------------

 

@echo off

REM set PHP_FCGI_CHILDREN=5
set PHP_FCGI_MAX_REQUESTS=1000

echo Starting PHP FastCGI...
RunHiddenConsole c:/php5/php-cgi.exe -b 127.0.0.1:9000 -c c:/php5/php.ini

echo Starting nginx...
RunHiddenConsole c:/nginx/nginx.exe -p c:/nginx

 

--------------------------------------------------------------

 

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

 

4.点击start.bat php-cgi 和 nginx如果在进程里,nginx和php-cgi都有.则成功一半

 

5.测试页面test.php

<?php

phpinfo();

?>

 

6.访问  http://localhost/test.php,上面的test.php要放在你自己配置的root根目录下

 

 

如果需要pdo的支持打开php.ini 并找到;extension=php_pdo_mysql.dll去掉前面的' ; ',   找到;extension_dir = "c:/php5/ext" 去掉前面的' ; ',c:/php5/ext  按自己的情况写

 

你可能感兴趣的:(console)