I’m trying to implement some kind of ‘multiprocessing’ in php for my task. The task is to check the status of every device in our network.
For that i decided to use looped exec and it works. But i don’t know whether it works fine or not:
$command = "php scan_part.php $i > null &";
exec($command);
This calls scan_part.php as many times as i need, but the question is: how can i calculate time needed for all of my scan_part.php‘s to be executed?
Please, help me, i’m stuck!
Use
proc_opento launch your script instead ofexec.Proc_openlets you wait until a process is done throughproc_close, which waits until the termination of the program.