This gist shows a problem I have with PHP's passthru() and exec() functions.
I have a shell script called daemon
that starts a background daemon. I'm my real project the background daemon is a Node.js server. Here I replaced it with a dummy daemon.php script. The shell script acts as a wrapper to make it easy to start and stop the server.
I also have a build script (Phing, here represented by a dummy phing.php
script). Phing can start the server using the shell script as well. But only if the shell script does not use process replacement. If the shell script does that, the passthru() call to the shell script will block. If the shell script just uses a regular path to a logfile, everything works as expected.