Go Back   CodingForums.com > Web Projects and Services Marketplace > Web Projects > Small projects (quick fixes and changes)

Notices

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 11-29-2011, 04:10 PM   PM User | #1
adarshakb
Regular Coder

 
adarshakb's Avatar
 
Join Date: Jun 2009
Location: Silicon valley of india
Posts: 247
Thanks: 11
Thanked 1 Time in 1 Post
adarshakb has a little shameless behaviour in the past
Smile Help with fixing a CRON job

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.


Quote:
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.
__________________
Two things are infinite: the universe and human stupidity; and I'm not sure about the universe.

Albert Einstein
-----------------------------------------------------
My Blog songs

Last edited by adarshakb; 11-29-2011 at 04:14 PM..
adarshakb is offline   Reply With Quote
Old 11-29-2011, 05:45 PM   PM User | #2
Fumigator
UE Antagonizer


 
Fumigator's Avatar
 
Join Date: Dec 2005
Location: Utah, USA, Northwestern hemisphere, Earth, Solar System, Milky Way Galaxy, Alpha Quadrant
Posts: 7,687
Thanks: 42
Thanked 637 Times in 625 Posts
Fumigator is a glorious beacon of lightFumigator is a glorious beacon of lightFumigator is a glorious beacon of lightFumigator is a glorious beacon of lightFumigator is a glorious beacon of light
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?
__________________
Fumigator is offline   Reply With Quote
Old 11-29-2011, 05:53 PM   PM User | #3
adarshakb
Regular Coder

 
adarshakb's Avatar
 
Join Date: Jun 2009
Location: Silicon valley of india
Posts: 247
Thanks: 11
Thanked 1 Time in 1 Post
adarshakb has a little shameless behaviour in the past
Quote:
Originally Posted by Fumigator View Post
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?
__________________
Two things are infinite: the universe and human stupidity; and I'm not sure about the universe.

Albert Einstein
-----------------------------------------------------
My Blog songs
adarshakb is offline   Reply With Quote
Old 11-29-2011, 06:34 PM   PM User | #4
honestcoder
New to the CF scene

 
Join Date: Nov 2011
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
honestcoder is an unknown quantity at this point
Quote:
Originally Posted by adarshakb View Post
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
honestcoder is offline   Reply With Quote
Old 11-29-2011, 06:37 PM   PM User | #5
brentc73
New Coder

 
Join Date: Aug 2006
Posts: 20
Thanks: 1
Thanked 0 Times in 0 Posts
brentc73 is an unknown quantity at this point
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.
__________________
Brent C
www.provoke-me.com
brentc73 is offline   Reply With Quote
Old 11-29-2011, 08:10 PM   PM User | #6
myfayt
Senior Coder

 
Join Date: Apr 2010
Posts: 1,159
Thanks: 46
Thanked 96 Times in 95 Posts
myfayt can only hope to improve
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.
__________________
Been a sign maker for 6 years. My business:
American Made Signs
myfayt is offline   Reply With Quote
Old 02-13-2012, 07:31 PM   PM User | #7
gimme987
New to the CF scene

 
Join Date: Feb 2012
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
gimme987 is an unknown quantity at this point
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.

Last edited by WA; 02-13-2012 at 09:08 PM..
gimme987 is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 04:20 AM.


Advertisement
Log in to turn off these ads.