See bbsbbs. csdn. under the normal configuration of nettopics390803643close, the php-cgi of window does not have multi-thread sub-processes. The following configuration is fastcgi_pass127.0.0.1: 9000. This means that when two php files request resolution at the same time, blocking processing will occur, and the processing time will be. phpb. php, not parallel
See bbs http://bbs.csdn.net/topics/390803643/close normal configuration, window of php-cgi is not multithreading/sub process, the following configuration fastcgi_pass 127.0.0.1: 9000; this means that when the two PHP files request resolution at the same time, blocking will occur, and the processing time will be. phpb. php, not parallel
See bbs
Http://bbs.csdn.net/topics/390803643/close
Under normal configuration, the php-cgi of window does not contain multithreading/sub-processes.
Fastcgi_pass 127.0.0.1: 9000;
This means that when two php files request resolution at the same time, blocking will occur, and the processing time will be a. php + B. php, rather than parallel, it is the serial time.
For example, a. php
Sleep (100); echo 1;
B. php
Echo 2;
Run. php, output in 100 seconds 1. run. run B. php, 2 appears after 100 seconds. suppose... but it does not appear immediately after the operation, because the above configuration is affected, resulting in the resolution of the serial time.
After several hours at google.
Find
The problem is that the PHP_FCGI_CHILDREN environment variable is ignored under windows, therefore php-cgi does not spawn children, and when PHP_FCGI_MAX_REQUESTS is reached the process terminates.
Check on PHP's source, file cgi_main.c, around line 1982:
# Ifndef PHP_WIN32
/* Pre-fork, if required */
If (getenv ("PHP_FCGI_CHILDREN ")){
Char * children_str = getenv ("PHP_FCGI_CHILDREN ");
...
So, php with fast-cgi will ** never ** work on Windows.
The question is, why is forking disabled under windows?
--------------- Https://bugs.php.net/bug.php? Id = 49859 -----------
We know window does not support ?????
There are a lot of people on the Internet who don't know how to deal with it. But I'm testing the server and think it's okay. I just need to start a few php-cgi manually.
As a result.
Start n php-cgi manually.
: Windows does not support multiple nginx threads. You can only manually generate multiple php-cgi
Start "fcgi service"/MIN/D "% batDir % php" php-cgi.exe-B 127.0.0.1: 9000-c "% batDir % php/php. ini"
Start "fcgi service"/MIN/D "% batDir % php" php-cgi.exe-B 127.0.0.1: 9001-c "% batDir % php/php. ini"
Start "fcgi service"/MIN/D "% batDir % php" php-cgi.exe-B 127.0.0.1: 9002-c "% batDir % php/php. ini"
Start "fcgi service"/MIN/D "% batDir % php" php-cgi.exe-B 127.0.0.1: 9003-c "% batDir % php/php. ini"
Start "nginx service"/MIN/D "% batDir % nginx" nginx.exe
Then nginx
Http {
# Window cannot dispatch child processes. Only PHP_FCGI_CHILDREN can be manually configured and does not work in window.
Upstream fastcgi_backend {
Server 127.0.0.1: 9000;
Server 127.0.0.1: 9001;
Server 127.0.0.1: 9002;
Server 127.0.0.1: 9003;
}
Get a backup server
When configuring a domain name, use forward to the backup server
Server {
Listen 80;
Server_name q. qq;
Access_log./../log/q.qq.access.txt;
Root d:/web/www;
Location ~ \. Php $ {
Fastcgi_pass fastcgi_backend;
}
}
OK. If you open four php files at the same time, it can be parsed independently and parsed in parallel. But what about five php files? Please wait for 5th ..........