title: Running Cronjob from a specific directory
body: <p>I created a php script for generating RSS feeds which is to eventually be run via a Cronjob.</p>
  
  <p>All the php files and the resulting RSS xml will be within a sub folder in a website. The php script runs fine on my local dev if I use terminal or the browser while within the same directory on my local development machine.</p>
  
  <pre><code>e.g. php /Library/WebServer/Documents/clientname/siteroot/rss/dorss.php
  </code></pre>
  
  <p>works fine as does navigating to the dorss.php file in Chrome.</p>
  
  <p>The CronJob has executed though with errors related to the fact that it cannot find the files specified with require_once() which are located in the same folder as rss or in a subfolder of that.</p>
  
  <p>Long story short I need to have the Cronjob run from within the same directory as the dorss.php file so it can reference the include files correctly.</p>
  
  <p>My knowledge on setting up a cronjob is VERY limited so I wanted to ask if this is at all possible (Change directory before running command) to do this on the same command line of the crontab or if not how can it be achieved please?</p>
  
  <p>The current cronjob command is</p>
  
  <pre><code>0 0,6,12,18 * * * /usr/bin/php /var/www/vhosts/clientname/stagingsite/rss/dorss.php
  </code></pre>
  
  <p>TIA
  John</p>