title: What is the best way to write a cron job that executes a PHP file with URL parameters?
body: <p>I'm trying to setup some cron jobs that run a PHP script every 3 hours. I have three jobs all hitting the same script, but with different parameters.</p>
  
  <p><strong>Option 1</strong></p>
  
  <p>I've learned that I can run the script right on the server like this:</p>
  
  <p><code>* */3 * * * /usr/bin/php /var/www/mysite.com/public/index.php param=value &gt; /dev/null 2&gt;&amp;1</code></p>
  
  <p><strong>Option 2</strong></p>
  
  <p>I've also learned that I can <code>cURL</code> the URL like this:</p>
  
  <p><code>* */3 * * * curl http://myip/mysite.com/public/index.php?param=value &gt; /dev/null 2&gt;&amp;1</code></p>
  
  <p><strong>Which is better?</strong></p>
  
  <p>My script makes use of the <code>$_GET[]</code> variables, and I'd like to keep it that way, but apparently when you run a script from the command line, you need to use the <code>$argv</code> variable instead of <code>$_GET[]</code>. For that reason, the <code>cURL</code> method seems like the better approach.</p>
  
  <p>However, I'm wondering if there is any difference between these two approaches, performance wise. Are there any downfalls of using <code>cURL</code> instead of just running the script locally on the server?</p>
  
  <p>Or, alternatively, is there any way to use <code>$_GET[]</code> when running the script on the server (instead of <code>$argv</code>)?</p>