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

From: Date: Tue, 05 Jan 2016 02:10:23 +0000
Subject: Bug #71209 [Opn]: php-cgi script hangs when started from php-fpm via system(), passthru() etc.
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-198417@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=71209&edit=1 ID: 71209 User updated 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 7/.0.1 +PHP Version: 5.6.16 / 7.0.1 Block user comment: N Private report: N New Comment: Fixed versions. Previous Comments: ------------------------------------------------------------------------ [2015-12-25 06:24:02] lameventanas at gmail dot com Disregard my previous comment, the same thing happens with 5.6.2, and even 7.0.1. ------------------------------------------------------------------------ [2015-12-24 10:44:19] lameventanas at gmail dot com 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. ------------------------------------------------------------------------ [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

« previous php.bugs (#198417) next »