I have to start many scripts from PHP and finish them as fast as possible. These scripts are written in a different language, though. I’ve started them somehow but I don’t know how to wait for them. My code:
foreach ($commands as $command) {
exec($command.' &');
}
The PHP script stop execution but there is still a lot of work in the background. How to wait in PHP for these tasks?
Similar questions:
Parallel processing in PHP - How do you do it? – waiting/synchronisation ignored
Executing multiple PHP scripts in parallel, and being notified when finished – limited to PHP scripts