title: cPanel's cron job creates aliases of PHP file for unknown reason...?
body: <p>I have cron jobs setup that runs a few PHP scripts often. The issue is that each time it runs a script, it create an alias of it, or an empty file with the same filename and a number added at the end.</p>
  
  <p>For instance, one of the files are activesessions_update.cron.php, here is the script inside it:</p>
  
  <pre><code>&lt;?php
    $memcache = new Memcache; 
    $memcache-&gt;connect('127.0.0.1', 11211);
    $activeSessions = $memcache-&gt;getStats(); 
  
    // using heredoc
  $file_content = &lt;&lt;&lt;TEXT
  &lt;?php
  
  \$activeSessions = {$activeSessions['curr_items']};
  
  ?&gt;
  TEXT;
  
  // this would be a user-defined function
  file_put_contents("activesessions.php", $file_content);
  ?&gt;
  </code></pre>
  
  <p>In my route folder, this is how it looks like: <a href="http://i.imgur.com/kS1JY.png" rel="nofollow">http://i.imgur.com/kS1JY.png</a></p>
  
  <p>In cPanel, the cron job runs the command:</p>
  
  <pre><code>/usr/bin/wget http://domain.com/x/activesessions_update.cron.php
  </code></pre>
  
  <p>I have no idea what the problem is. I am forced to delete 10,000s of these empty files every week. Please note that <strong>I have no experience in PHP programming</strong> as I did not code it myself so any replies would be appreciated with utter detail. Who can guide me to solve this puzzle?</p>
  
  <p>EDIT: Got the solution from techincal support of my host:</p>
  
  <blockquote>
    <p>It wasn't logging exactly, by default wget is used to download files. 
    So when you run wget against that url it goes out, requests the file,
    and downloads the output of the request, essentially saving a copy of
    what you would get in your browser if you pulled it up.  By adding the
    -O /dev/null to the command you are telling it that instead of saving
    that output to the default location (generally wherever it was being
    called from) to save it to /dev/null which is really just nowhere
    (basically just throws it away)</p>
  </blockquote>