Bug #71209 [Com]: php-cgi script hangs when started from php-fpm via system(), passthru() etc.

[email protected] ("lameventanas at gmail dot com")
Newsgroups php.bugs
Message-ID <[email protected]>
Edit report at https://bugs.php.net/bug.php?id=71209&edit=1

 ID:                 71209
 Comment by:         lameventanas at gmail dot com
 Reported by:        lameventanas at gmail dot com
 Summary:            php-cgi script hangs when started from php-fpm via
                     system(), passthru() etc.
 Status:             Open
 Type:               Bug
 Package:            Scripting Engine problem
 Operating System:   Linux
 PHP Version:        5.6.16
 Block user comment: N
 Private report:     N

 New Comment:

This didn't happen with 5.6.2, but I'm uncertain of which version introduced the change.

Note that /usr/bin/php-cgi is SAPI cgi-fcgi.
was compiled with --disable-cli and --enable-cgi.

If I use #!/usr/bin/php in script.php (CLI SAPI), it doesn't hang.


Previous Comments:
------------------------------------------------------------------------
[2015-12-24 03:17:25] lameventanas at gmail dot com

Description:
------------
My lighttpd server uses fastcgi to run php code.

The php code starts an external program that happens to be a standalone php script (shebang: #!/usr/bin/php-cgi).

The script hangs when started from a php-fpm process manager, but works fine when started from a php-cgi "process manager".

Just to clarify, the process that hangs is the php-cgi which is interpreting the standalone script.  If I replace this with a shellscript, everything works fine.

Test script:
---------------
test.php:
<?
header("Content-type: text/plain");
echo "Starting\n";
system("/var/www/htdocs/script.php");
echo "Finished\n";
?>

script.php:
#!/usr/bin/php-cgi -q
<?
echo "Hello world!\n";
?>


Expected result:
----------------
No hangs.



------------------------------------------------------------------------



--
Edit this bug report at https://bugs.php.net/bug.php?id=71209&edit=1
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.