Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 7 of 7
  1. #1
    Regular Coder adarshakb's Avatar
    Join Date
    Jun 2009
    Location
    Silicon valley of india
    Posts
    247
    Thanks
    11
    Thanked 1 Time in 1 Post

    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.


    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.
    Last edited by adarshakb; 11-29-2011 at 04:14 PM.
    Two things are infinite: the universe and human stupidity; and I'm not sure about the universe.

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

  • #2
    UE Antagonizer Fumigator's Avatar
    Join Date
    Dec 2005
    Location
    Utah, USA, Northwestern hemisphere, Earth, Solar System, Milky Way Galaxy, Alpha Quadrant
    Posts
    7,691
    Thanks
    42
    Thanked 637 Times in 625 Posts
    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?

  • #3
    Regular Coder adarshakb's Avatar
    Join Date
    Jun 2009
    Location
    Silicon valley of india
    Posts
    247
    Thanks
    11
    Thanked 1 Time in 1 Post
    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

  • #4
    New to the CF scene
    Join Date
    Nov 2011
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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

  • #5
    New Coder
    Join Date
    Aug 2006
    Posts
    20
    Thanks
    1
    Thanked 0 Times in 0 Posts
    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.

  • #6
    Senior Coder
    Join Date
    Apr 2010
    Posts
    1,453
    Thanks
    71
    Thanked 102 Times in 101 Posts
    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 7 years. My business:
    American Made Signs

  • #7
    New to the CF scene
    Join Date
    Feb 2012
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •