...

View Full Version : Help with fixing a CRON job



adarshakb
11-29-2011, 04:10 PM
1) Project Details: (be as specific as possible):

The problem i am facing currently is that I have a fine working php script, which executes and has NO problems. I just want to run it as a CRON JOB every hour. My host is godaddy.com and i have followed the required steps. But still it gives me the following email as the error.



From: root@[....removed....].secureserver.net (Cron Daemon)
Date: October 25, 2011 6:00:02 PM EDT
To: [....removed....]
Subject: Cron <shailupreti@p3slhjava06> /web/cgi-bin/php5 "[....removed....]"

Set-Cookie: PHPSESSID=n4j3es86mgffj5m0mhdrdj6o42; path=/
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Pragma: no-cache
Content-type: text/html


I am ready to hire anyone who can fix this and get the script to run as a CRON job every hour. It is important to properly document this error and give a solution and help us till the CRON job runs.
2) Payment method/ details (Paypal, check? Timeline?):

Paypal is best for me.
Timeline is your wish, tho i think its not a very big job.
Leave a personal message and your quote.
We can even put a back link to your site in the credits section.

Fumigator
11-29-2011, 05:45 PM
The best solution is to drop Godaddy like it's got leprosy and find yourself a decent hosting company.

I realize this isn't the place to troubleshoot the problem, but what does your PHP error log say?

adarshakb
11-29-2011, 05:53 PM
The best solution is to drop Godaddy like it's got leprosy and find yourself a decent hosting company.

I realize this isn't the place to troubleshoot the problem, but what does your PHP error log say?

There is no error when i run my script manually in a browser/on local host too. But i dono where is my php error log is. Where can i find it?

honestcoder
11-29-2011, 06:34 PM
There is no error when i run my script manually in a browser/on local host too. But i dono where is my php error log is. Where can i find it?

For the error log, see this: http://help.godaddy.com/article/1197

I didn't know they did that, another reason to go to a different host....

I guess it's unlikely with a Godaddy shared account so it might not be anything to do with this but if you have more than one php installation on your server, you could well be running a different php in your cron to the one that Apache is running (cgi?) and depending on the options it was built with could cause an error that you wouldn't see in a browser.

Hard to say without seeing the logs, but I had this same issue once with a cron that wouldn't run. In that case, if you can get shell access you would run the exact same command as is in your cron and see what the command line output is.

The first thing I would do is check the cron script's permissions to check it can be run by cron... that and check the logs of course ;)

brentc73
11-29-2011, 06:37 PM
You need to go into your cpanel, under advanced select "Cron Jobs" -
Make sure you have the correct email under current email.

Then under "Add New Cron Job" / Common setting select "once an hour". In command you need to add "php -q /home/directory/public_html/yourscript.php > /dev/null 2>&1".

/home/directory/public_html/ - Path to your php or cgi script
yourscript.php -the script you would like to run
/dev/null 2>&1 - this prevents an email notification as in my case my script already sends me an email.

Hope this helps.

myfayt
11-29-2011, 08:10 PM
Out of the 5 hosting companies I've used. Hostmonster is the best yet and it's an American company. I've been using them for 4 1/2 years without any issues, and I run 3 cron jobs. You don't have to manually set them, just go into your control panel, choose the file to run and click when to run it, *poof* done. :thumbsup:

gimme987
02-13-2012, 07:31 PM
I guess it's unlikely with a Godaddy shared account so it might not be anything to do with this but if you have more than one php installation on your server, you could well be running a different php in your cron to the one that Apache is running (cgi?) and depending on the options it was built with could cause an error that you wouldn't see in a browser.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum