If a PHP script is run as a cron script, the includes often fail if relative paths are used. For example, if you have
require_once(\'foo.php\');
In addition to the accepted answer above, you can also use:
chdir(__DIR__);