fry2010 Posted March 3, 2012 Share Posted March 3, 2012 I have created a cron task on dedicated server. It is requesting a php page. Both are under the 'root' user, and 777 permissions. This is purely to get it working. It is executing the php script, but the includes with the php script are not being included. Here are the error messages I get: PHP Deprecated: Comments starting with '#' are deprecated in /etc/php5/cli/conf.d/imap.ini on line 1 in Unknown on line 0 PHP Warning: Directive 'safe_mode' is deprecated in PHP 5.3 and greater in Unknown on line 0 PHP Warning: include_once(): Unable to access ../globalConfig.php in /var/www/vhosts/***REMOVED****/inc/cronTasks/pull.php on line 4 PHP Warning: include_once(../globalConfig.php): failed to open stream: No such file or directory in /var/www/vhosts/***REMOVED****/inc/cronTasks/pull.php on line 4 Anyone got any ideas? The php file here is within the same directory as the files I am trying to include. So I am pretty sure it is finding the included files, it's just not being allowed to include it. I have set the include paths correctly as includes are working, it's only when I use it as a cron job. The cron job is performed by 'root' user as well. Quote Link to comment https://forums.phpfreaks.com/topic/258217-cron-task-php-with-include-cant-open-it/ Share on other sites More sharing options...
trq Posted March 4, 2012 Share Posted March 4, 2012 You need to use absolute paths from within cron as it doesn't have a $PATH variable set and doesn't execute from where you think it might. Quote Link to comment https://forums.phpfreaks.com/topic/258217-cron-task-php-with-include-cant-open-it/#findComment-1323619 Share on other sites More sharing options...
fry2010 Posted March 4, 2012 Author Share Posted March 4, 2012 thanks thorpe! Quote Link to comment https://forums.phpfreaks.com/topic/258217-cron-task-php-with-include-cant-open-it/#findComment-1323622 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.