Possible Duplicate:
php in background exec() function
I am trying to run two exec commands from PHP. One is a script that might run for a few minutes and there can only be once instance of it. The second exec just checks if the first process is running and either lets you run it again or redirects you. The code is something like this.
This is the main process
$command = '/home/user/active/Nem-Swd.elf 30 > /dev/null 2>&1 & echo $!';
This is the process that checks if the other one is running already.
exec("ps ax | grep $name 2>&1", $output);
I know that in the php API it says :
If a program is started with this function, in order for it to continue running in the background, the output of the program must be redirected to a file or another output stream. Failing to do so will cause PHP to hang until the execution of the program ends.
But I don't understand what that implies.