envexlabs Posted October 1, 2008 Share Posted October 1, 2008 Hey, I have a set of cron php pages that are set to run everyday. When i view the page through a browser i don't get any errors, but when the cron runs and sends me an email of the status, i get this: Warning: include(/inc/config.php): failed to open stream: No such file or directory in /bill_time.php on line 4 Warning: include(): Failed opening '/inc/config.php' for inclusion (include_path='.:/usr/local/php5/lib/php:/usr/local/lib/php') in /bill_time.php on line 4 Any ideas why the cron would be giving me errors? Thanks, envex Quote Link to comment https://forums.phpfreaks.com/topic/126610-solved-cron-problem/ Share on other sites More sharing options...
trq Posted October 1, 2008 Share Posted October 1, 2008 Are you using absolute paths within your scripts? You need to be. Quote Link to comment https://forums.phpfreaks.com/topic/126610-solved-cron-problem/#findComment-654724 Share on other sites More sharing options...
envexlabs Posted October 1, 2008 Author Share Posted October 1, 2008 I'm using $_SERVER['DOCUMENT_ROOT'].'/inc/script.php' for all the paths. still not working. Quote Link to comment https://forums.phpfreaks.com/topic/126610-solved-cron-problem/#findComment-654802 Share on other sites More sharing options...
trq Posted October 1, 2008 Share Posted October 1, 2008 The $_SERVER array meens nothing to cron, as your script isn't executed via the server usually. Can wee see your crontab? Quote Link to comment https://forums.phpfreaks.com/topic/126610-solved-cron-problem/#findComment-654805 Share on other sites More sharing options...
envexlabs Posted October 1, 2008 Author Share Posted October 1, 2008 That makes sense, I'm using the cron through dreamhosts panel, i'm just going to grab the absolute path, and try hard coding it in. Thanks. Quote Link to comment https://forums.phpfreaks.com/topic/126610-solved-cron-problem/#findComment-654810 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.