由于工作需要需要在本地搭建多个项目进行开发和调试,项目之间通过http,curl请求访问,本地系统为windows+phpstudy方式在本地搭建系统时会出现调用卡死的情况因为本地的所有nginx配置的fast cgi 端口都为9000,windows下 php+fastcgi php 不支持并发,造成循环请求死锁。解决办法为:进入C:\phpStudy\PHPTutorial\php\php-7.1.13-nts(我的安装目录是这里,大家请按照自己的所在安装目录),在这个目录下打开cmd命令行,输入命令php-cgi.exe -b 127.0.0.1:9001 -c php.ini (重新启动一个cgi端口,这个命令行窗口不能关,要一直开着),然后在修改vhost的配置,我的系统建了虚拟目录,所以修改虚拟目录的配置:
修改路径如下:C:\phpStudy\PHPTutorial\nginx\conf\vhosts
在配置文件中:
server {
listen 8101;
server_name bmmerchants.com;
root "C:/phpStudy/PHPTutorial/WWW/merchants/public";
location / {
index index.html index.htm index.php l.php;
try_files $uri $uri/ /index.php?$query_string;
autoindex off;
}
error_page 500