Hi so i am wondering if somebody can offer me a solution..
I have multiple instances of a php script i would like to run at once, I can semi achieve this using shell_exec() and not waiting for a response apart from the pid. This works wonderfully. However when doing this with the method below it works well for 100 or so executes but I need it to execute around 1000 times and it is taking too long to loop around the foreach and execute 1 by one.
Example:
$items = $array(daatabase entries);
foreach($items as $i){
$pid = shell_exec("execute the process.php");
}
Now assuming there are < 100 this will take around 1 second or so to exec which is OK however i need to run loads of these and this will take 10-20 seconds.
Is there any way of sending the commands in bulk rather than 1 at a time?
Thanks