一、安装说明
1. 下载解压后,进入nginx目录后,根据当前实际目录路径调整start_nginx.bat、stop_nginx.bat路径,修改nginx.conf配置php的项目路径等
start_nginx.bat>
::@echooff@b@ @b@set PHP_FCGI_MAX_REQUESTS=1000@b@ @b@echo Starting PHPFastCGI...@b@RunHiddenConsole C:/apps/np/php5/php-cgi.exe -b 192.168.1.201:9008 -c C:/apps/np/php5/php.ini@b@ @b@echo Starting nginx...@b@RunHiddenConsole C:/apps/np/nginx/nginx.exe -p C:/apps/np/nginx
stop_nginx.bat>
#@echooff@b@echo Stoppingnginx... @b@taskkill /F /IM nginx.exe > nul@b@echo Stopping PHPFastCGI...@b@taskkill /F /IM php-cgi.exe > nul@b@exit
nginx.conf>
..@b@location / {@b@ root C:/apps/np/deploy; @b@ index index.php index.html index.htm index.jsp ;@b@ } @b@ ..@b@ location ~ \.php$ {@b@ root C:/np/wnmp2/deploy;@b@ fastcgi_pass 192.168.1.201:9008;@b@ fastcgi_index index.php;@b@ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;@b@ include fastcgi_params;@b@ }@b@ ..
2. 进入php5目录,并修改php.ini配置文件(根据实际路径修改php.ini中的extension_dir)
..@b@; The directory under which PHP opens the script using /~username used only@b@; if nonempty.@b@user_dir =@b@@b@; Directory in which the loadable extensions (modules) reside.@b@extension_dir = "C:/apps/gn/php5/ext"@b@..
4. 测试php代码如下
<html>@b@ <head>@b@ <title>PHP 测试</title>@b@ </head>@b@ <body>@b@ <?php echo '<p>Hello World</p>'; ?>@b@ </body>@b@</html>