title: Task/Job scheduling on PHP
body: <p>Our system based on Zend 1 has a background process running as daemon to check hourly whether user has expired or not, if yes, the system will send verification email to these expired users.</p>
  
  <p>The code is really simple:</p>
  
  <pre><code>while(1) {
      $worker = ... //get verification worker
      $worker-&gt;run();
  
      sleep(3600); //run hourly
  }
  </code></pre>
  
  <p>We would like to look for better approach with free tool to replace this code to schedule job in the system. Zend Job Queue is really good approach but it is commercial.</p>
  
  <p>My thinking on two below approaches as Zend Job Queue alternative:</p>
  
  <ol>
  <li><p>Instead of running daemon, configure cron jobs on crontab to run PHP script hourly, but I am not sure whether it is better on above code or not. </p></li>
  <li><p>Run <a href="https://github.com/ncb000gt/node-cron" rel="nofollow">node cron</a> on nodejs server to call PHP script directly.</p></li>
  </ol>
  
  <p>I also have looked on Gearman and beanstalked whether they supports on job scheduling but really stumped on this way.</p>
  
  <p>Please suggest if there is any better approach to schedule task on PHP.</p>