Jump to content

Recommended Posts

Posted

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.

Posted

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";

Posted
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.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...