为了多版本共存,手动启动php56,指定端口9001
以下代码做成bat,双击执行
使用软件RunHiddenConsole后台运行。RunHiddenConsole下载
@ECHO OFF
ECHO Starting PHP5.6 FastCGI...
D:/RunHiddenConsole.exe G:/php/php-5.6.27-nts/php-cgi.exe -b 127.0.0.1:9001
nginx配置的时候,指定127.0.0.1:9001
server {
listen 9000;
server_name localhost;
# root的路径为网页目录
root "c:/Software/htdocs";
location / {
index index.html index.php;
autoindex on;
}
# fastcgi_pass要与下面php-cgi的地址一样
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9001;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}