|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #49859 PHP_FCGI_CHILDREN not work
Submitted: 2009-10-13 08:00 UTC Modified: 2009-10-19 14:40 UTC
From: loki5100-nospam at yahoo dot fr Assigned:
Status: Not a bug Package: PHP options/info functions
PHP Version: 5.3.0 OS: Windows Vista
Private report: No CVE-ID: None
 [2009-10-13 08:00 UTC] loki5100-nospam at yahoo dot fr
i found a bug in PHP-cgi.exe

I use Php-cgi as fastCgi

php-cgi.exe -b host:port

i set in environement variables this :


in the task manager i see only one  Php-cgi.exe
process (when normaly i must see 9 process no?)
and after i send more than 1000 request the
php-cgi.exe process died ! and i must manually
restart it! that not a normal behavior when 

Reproduce code:
set in environement variables :

exec: php-cgi.exe -b

see in task manager only one Php-cgi.exe process

send more than 1000 request to php-cgi.exe, the process will die and you will need to manually restart it ! 

Expected result:
process must be restarted automatiquely

Actual result:
the main process die and you need to manually restart it ! 


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2009-10-19 14:40 UTC]
You have just set the environment variables in wrong place / wrong way. (no idea how you do that in windows, but this works just fine under *nix) 
 [2012-04-04 12:12 UTC] strayer at olle-orks dot org
I just discovered this while checking out xcache and this really doesn't work... 
phpinfo() even shows the env var in its output!

# php-cgi -b

Process Explorer shows only one process with one thread.

Ran phpinfo() via browser:


It looks like php-cgi just ignores the PHP_FCGI_CHILDREN, since 
PHP_FCGI_MAX_REQUESTS seems to be working as intended.
 [2012-08-03 18:34 UTC] zyss at mail dot zp dot ua
I have the same problem. We're using PHP with windows embedded.

PHP just ignores this environment variable (PHP_FCGI_CHILDREN).

Please reopen this bug.
 [2012-08-23 19:38 UTC] matheus at gigatron dot com dot br
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?
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Tue Nov 28 14:01:26 2023 UTC