saikumar611 Posted March 26, 2007 Posted March 26, 2007 Hi, I am attempting to have a particular URL on one of my domains hosted at TCH as a scheduled Cron job. I had the http URL to the script file (.php file) and set up the schedule for the same too. Everytime I access the URL manually I am able to execute the script perfectly fine without any issues but the job just does not run under the Cron schedule. I had a support ticket raised today and was informed by the support executive that he had modified the job to the following: 0 8 * * * cd /home/######/public_html/cron; /usr/local/bin/php -q somefilename2.php He also mentioned that he was getting the following errors : Warning: main(/common/session.php): failed to open stream: No such file or directory in /home/######/public_html/property/classes/somefilename2.php on line 2 Warning: main(): Failed opening '/common/session.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/######/public_html/property/classes/somefilename2.php on line 2 Warning: main(/common/db_cnx.php): failed to open stream: No such file or directory in /home/######/public_html/ABCDXYZ/classes/somefilename2.php on line 3 As soon as I received this response, I tried executing the script through the http URL again but did not come across any errors and the script worked absolutely fine without any issues. The following is a sample of the code that I have in place to do the include for the code files: include_once "../common/ABCD.php"; include_once "../common/myconfigdata.inc"; include_once "../common/db_cnx.php"; I am unable to understand how my script works fine when accessed over the http URL whereas throws errors when added under the cron by the support executive using the command listed above. Any response will be deeply appreciated. Thanks a lot in advance. Quote
TCH-Bruce Posted March 26, 2007 Posted March 26, 2007 Welcome to the forum, saikumar611 I recommend that you change the php file you are trying to execute with cron to have full paths to your include files. >include_once "/home/xxxx/public_html/common/xxxx.php"; Quote
saikumar611 Posted March 26, 2007 Author Posted March 26, 2007 Welcome to the forum, saikumar611 I recommend that you change the php file you are trying to execute with cron to have full paths to your include files. >include_once "/home/xxxx/public_html/common/xxxx.php"; Hey Bruce. Thanks a lot for this bit of information, will try it out and update you. Quote
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.