Help Cron Jobbing a php script

Discussion in 'HTML & Website Design' started by krebs, Dec 21, 2009.

  1. #1
    I am trying to run a daily PHP script with cron job. I use godaddy cron manager and have that setup correctly. After the set time passes, the script has not run and I get no email response with an error or success message. To me that says that the cron didnt even run.

    I know the script works because I see the results when I type the php file into a web browser, the script is working.
    My question: Is there something I am missing? Or is there another way to run a php script every day?

    Here is the script I am using.

    And after investing so much time into Cron Jobs I do have to ask, is there an easier way to have a quote of the day?

    Thanks in advance for your continued assistance!
     
    krebs, Dec 21, 2009 IP
  2. thuankkk

    thuankkk Active Member

    Messages:
    503
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    95
    #2
    thuankkk, Dec 21, 2009 IP
  3. krebs

    krebs Greenhorn

    Messages:
    44
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    18
    #3
    Thanks for the link. I will consider it.

    Anyone know how to work around this without signing up for another service?

    Thanks all.
     
    krebs, Dec 21, 2009 IP
  4. krebs

    krebs Greenhorn

    Messages:
    44
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    18
    #4
    That link you suggest isnt going to work. Really I want to set it and not have to worry about it expiring. I also dont feel I should pay as I am already paying for service which should provide this. Surely someone must know how to properly setup a cron job to run a PHP script through godaddy.

    Anyone?
     
    krebs, Dec 21, 2009 IP
  5. thuankkk

    thuankkk Active Member

    Messages:
    503
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    95
    #5
    Hi krebs,

    I think you'd better contact godaddy, and they will give you the instruction. You paid for your service, so don't hesitate to ask them.

    About the expiry date, it's a limit of my service. You can try onlinecronjobs.com (for sale??, and must verify your site by putting a txt file), or cronless.com where you can create cron jobs every day for free without expiry date.

    Hope this helps :)

    Kind regards,
    Nguyen An Thuan.
     
    thuankkk, Dec 22, 2009 IP
  6. hdewantara

    hdewantara Well-Known Member

    Messages:
    541
    Likes Received:
    47
    Best Answers:
    25
    Trophy Points:
    155
    #6
    Just wonder that if the target is one's web browser,
    why not just to have a random quote
    at any time someone browses to your site?

    Moreover, these quotes need not to be a secured matter,
    so you must keep them on your server... do they?
    Then I think it shall be run on a client side browser instead.

    Unless you have your own purpose :)

    Regards,
     
    hdewantara, Dec 27, 2009 IP
  7. DocuMaker

    DocuMaker Active Member

    Messages:
    427
    Likes Received:
    16
    Best Answers:
    0
    Trophy Points:
    60
    #7
    When I run into this problem it's usually due to the way cron finds and interacts with the file. I can only offer two suggestions. Try each. Both won't work -- only one will.

    1. /opt/curlssl/bin/curl -s http://www.website.com/script.php

    2. cd /home/username/public_html/directory && ./script.php

    In #2, replace /home/username/public_html/directory with the PATH to your php file and the directory it sits in. And don't remove the " && ./" part.
     
    DocuMaker, Dec 28, 2009 IP
  8. krebs

    krebs Greenhorn

    Messages:
    44
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    18
    #8
    Great thanks for the assistance. I actually contacted Godaddy support and they figured it out. There was a problem on Godaddy's end and the jobs weren't being sent at all.

    The first 2 calls to support the douche bag on the phone said it was a problem with my script. Finally they sent my query to advanced support who figured it out immediately. Sometimes I love being right...

    thanks again.
     
    krebs, Jan 7, 2010 IP