title: How to create cron job using PHP?
body: <p>I'm new to using cron job. I don't even know how to write it. I have tried to search from internet, but I still don't understand it well. I want to create a cron job that will execute my code every minute. I'm using PHP to create it. It is not working.</p>
  
  <p><strong>Example</strong></p>
  
  <p><strong>run.php</strong>  <em>(Code that will be executed every minute)</em></p>
  
  <pre><code>&lt;?php
  
  echo "This code will run every minute";
  
  ?&gt;
  </code></pre>
  
  <p><strong>cron.php</strong></p>
  
  <pre><code>&lt;?php
  
  $path = dirname(__FILE__);
  $cron = $path . "/run.php";
  echo exec("***** php -q ".$cron." &amp;&gt; /dev/null");
  
  ?&gt;
  </code></pre>
  
  <p><em>Suppose that these two files are in the same folder.</em></p>
  
  <p>Is the code that I did wrong? If wrong, please kindly tell me how to fix it.</p>