I'm trying to spawn multiple processes at once in PHP with proc_open, but the second call won't start until the first process has ended. Here's the code I'm using:
for ($i = 0; $i < 2; $i++)
{
$cmdline = "sleep 5";
print $cmdline . "\n";
$descriptors = array(0 => array('file', '/dev/null', 'r'),
1 => array('file', '/dev/null', 'w'),
2 => array('file', '/dev/null', 'w'));
$proc = proc_open($cmdline, $descriptors, $pipes);
print "opened\n";
}