title: Long running background process in PHP on windows machine
body: <p>I have a script in PHP that uses Curl to hit a long list of URLs one by one and write the response to a file at the end, I want the list to be uploaded from a browser and do rest of the processing in background (without making the user to wait for response). I have already tried the following solutions - </p>
  
  <pre><code>    $command = "C:\wamp\bin\php\php5.5.12\php.exe ../background_process/subscribe_bg.php ".$file_temp_path;
      shell_exec(sprintf('%s &gt; /dev/null 2&gt;/dev/null &amp;', $command));
  </code></pre>
  
  <p>This runs the script successfully, but makes the browser wait. (This will probably run in background on a Linux machine.)</p>
  
  <pre><code>    $command = "C:\wamp\bin\php\php5.5.12\php.exe ../background_process/subscribe_bg.php ".$file_temp_path;
  
      execInBackground($command);
  
      function execInBackground($cmd) { 
          if (substr(php_uname(), 0, 7) == "Windows"){ 
              pclose(popen("start /B ". $cmd, "r"));  
          } 
          else { 
              exec($cmd . " &gt; /dev/null &amp;");   
          } 
      }
  </code></pre>
  
  <p>I found this solution for windows machine, but doesn't work for me.The script does not execute at all.</p>
  
  <p>Please suggest the best practice to run a long process(not very long ~30-40 Minutes) in background using PHP on a windows machine.</p>