title: how to make non blocking call in php
body: <p>I am using a php script to upload lot of files. I am using the CURL command . The remote server accepts only POST requests. But when I execute the below script it processes the first request and waits until the first file is uploaded. Is there a way to make it non blocking and run simultaneous 2 curl upload requests .Find the code sample below.</p>
  
  <pre><code>&lt;?php
    $arr= array(somefile1.txt,somefile2.txt);
    for ( $i=0;$i&lt;2;$i++) {
       $cmd = "curl  -F name=aaa -F type=yyy  FileName=@/xxxxx/xxxx/$arr[$i] http://someurl.com";
       print "Executing file ";
       shell_exec("nohup  $cmd  2&gt; /dev/null &amp; echo $!" );
       print "=======  done ================";
    }
  ?&gt;
  </code></pre>