title: simultaneously exec multiple shell_exec() commands?
body: <p>Hi so i am wondering if somebody can offer me a solution..</p>
  
  <p>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.</p>
  
  <p>Example:</p>
  
  <pre><code> $items = $array(daatabase entries);
  
     foreach($items as $i){
      $pid = shell_exec("execute the process.php");
     }
  </code></pre>
  
  <p>Now assuming there are &lt; 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.</p>
  
  <p>Is there any way of sending the commands in bulk rather than 1 at a time?</p>
  
  <p>Thanks</p>