title: Running PHP file using command line as background process
body: <p>I have centos VPS hosting and installed WHM/cPanel . I want to run a php script using command line for unlimited time.</p>
  
  <p>My script is look like:</p>
  
  <pre><code>&lt;?php
  set_time_limit(0);
  while(true)
  {
  //code to send me email
  
  sleep(600);
  }
  ?&gt;
  </code></pre>
  
  <p>I know that this script should be run for unlimited time.</p>
  
  <p>I have used these commands:</p>
  
  <pre><code>php myfile.php &amp;
  nohup php myfile.php &amp;
  </code></pre>
  
  <p>I found these commands on stackoverflow. And these are running fine. But after one hours, It stop automatically.</p>
  
  <p>I think, i am doing right. But i do not know, which is killing that process.</p>
  
  <p>If not,</p>
  
  <p>i want to know that How to run this script for unlimited time.</p>