calling shell_exec(“php myscript.php”) goes into infinite loop
问题 I decided to fork out my php script because it takes too long to run. When I ran it shell_exec() call on a local linux machine, I did not see the infinite loop problem, but on a hosted machine, the script went into an infinite loop. I reduced the code to the minimum and I hope someone can help me see the problem here: 3 scripts are involved: test_shell.php --> issues shell_exec() to forkphp.sh --> which issues a command "path/to/php write_hello_world.php" starting from top to bottom order,