If I run this unix command directly in shell:
$ sleep 100 &
sleep runs in the background as expected, and I can continue working in the command line.
but trying the same thing with shell_exec() and php I get different results.
<?php
$sleep = $argv[1];
$shell="sleep " . $sleep . " &";
shell_exec($shell);
?>
when executing php sleep.php 100
the command line hangs and wont accept any more commands until sleep finishes. I am not sure whether this is a nuance I am missing with shell_exec()
/ $argv
of php or with the unix shell.
Thanks.