我发现了问题。一次运行 php 是不够的。PHP 尝试运行脚本和 curl 没有资源,我们有死锁。
我的解决方案是使用其他端口运行更多 php,并为此配置 nginx。用于 php 的 bat 脚本
c:/RunHiddenConsole.exe D:\AllWebServer\php\php-cgi.exe -b 127.0.0.1:9121 -c D:\AllWebServer\php\php.ini
c:/RunHiddenConsole.exe D:\AllWebServer\php\php-cgi.exe -b 127.0.0.1:9122 -c D:\AllWebServer\php\php.ini
c:/RunHiddenConsole.exe D:\AllWebServer\php\php-cgi.exe -b 127.0.0.1:9123 -c D:\AllWebServer\php\php.ini
c:/RunHiddenConsole.exe D:\AllWebServer\php\php-cgi.exe -b 127.0.0.1:9124 -c D:\AllWebServer\php\php.ini
c:/RunHiddenConsole.exe D:\AllWebServer\php\php-cgi.exe -b 127.0.0.1:9125 -c D:\AllWebServer\php\php.ini
c:/RunHiddenConsole.exe D:\AllWebServer\php\php-cgi.exe -b 127.0.0.1:9126 -c D:\AllWebServer\php\php.ini
c:/RunHiddenConsole.exe D:\AllWebServer\php\php-cgi.exe -b 127.0.0.1:9127 -c D:\AllWebServer\php\php.ini
c:/RunHiddenConsole.exe D:\AllWebServer\php\php-cgi.exe -b 127.0.0.1:9128 -c D:\AllWebServer\php\php.ini
c:/RunHiddenConsole.exe D:\AllWebServer\php\php-cgi.exe -b 127.0.0.1:9129 -c D:\AllWebServer\php\php.ini
和 nginx 配置
upstream php_farm {
server 127.0.0.1:9121 weight=1;
server 127.0.0.1:9122 weight=1;
server 127.0.0.1:9123 weight=1;
server 127.0.0.1:9124 weight=1;
server 127.0.0.1:9125 weight=1;
server 127.0.0.1:9126 weight=1;
server 127.0.0.1:9127 weight=1;
server 127.0.0.1:9128 weight=1;
server 127.0.0.1:9129 weight=1;
}
...
fastcgi_pass php_farm;