title: run php script in the background - windows
body: <p>I want to run php script that runs an infinity loop in the background of another php page without stopping or affecting the caller page, 
  what I've tried so far is this:
  in the caller page:</p>
  
  <pre><code>set_time_limit(0);
  ignore_user_abort(true); 
  $path=realpath('./infinity.php');
  $cmd='c:/xampp/php/php'.$path;
  if (substr(php_uname(), 0, 7) == "Windows"){ 
     exec("start/b C:\\xampp\\php\\php $path &gt; NUL");
  } 
  else { 
      exec($cmd . " &gt; /dev/null &amp;");   
  } 
  </code></pre>
  
  <p>in infinity.php</p>
  
  <pre><code>set_time_limit(0);
  ignore_user_abort(true); 
  </code></pre>
  
  <p>my problem is that when I try to open the caller page in the browser i see the loading mark forever and the page is never open!</p>
  
  <p>could you tell me what I'm missing?
  notice: 
  - i'm working on windows 8 
  - i've used set_time_limit(0) and ignore_user_abort(true) in both pages since i don't know how exactly i suppose  to use them.</p>
  
  <p>i know my question might be duplicated but i've tried all of the proposed solutions and i still can't open the caller page </p>
  
  <p>any help is appreciated</p>