longtone Posted May 4, 2008 Share Posted May 4, 2008 I'm a complete beginner to cron jobs I'm getting an error with my include files using: include_once($SERVER['DOCUMENT_ROOT'] ."/path/tofile.php"); Shouild I be using something like: include_once("/usr/bin/php /home/<username>/public_html/path/tofile.php"); Link to comment https://forums.phpfreaks.com/topic/104115-solved-how-do-i-write-include-paths-in-cron-scripts/ Share on other sites More sharing options...
trq Posted May 4, 2008 Share Posted May 4, 2008 The $SERVER array is non-existent, even $_SERVER is only available when your php script is called from within apache. Yes, you will need to use the full path to your script. Something like.... include "/home/username/path/tofile.php"; Link to comment https://forums.phpfreaks.com/topic/104115-solved-how-do-i-write-include-paths-in-cron-scripts/#findComment-533040 Share on other sites More sharing options...
longtone Posted May 5, 2008 Author Share Posted May 5, 2008 Thanks, that's got it working. Link to comment https://forums.phpfreaks.com/topic/104115-solved-how-do-i-write-include-paths-in-cron-scripts/#findComment-533119 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.