Community Forums
Connect with us on LinkedIn
+ Reply to Thread
Results 1 to 4 of 4
  1. #1
    Registered User
    Join Date
    Aug 2010
    Posts
    4

    Default CRON JOB Timing Out [500 Internal Server Error]

    Hi all,

    I have created a cron job which runs a single PHP file, send.php

    This file is meant to be running for about 10 hours. (I use sleep(30) between every task within the file and there are MANY tasks, around 1300)

    The thing is I received an email from the Cron Job which mentioned the failure of the Cron AFTER 20-30 minutes of successful running the PHP file.

    This is the last part of the email :

    Code:
    <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
    <html><head>
    <title>500 Internal Server Error</title>
    </head><body>
    <h1>Internal Server Error</h1>
    <p>The server encountered an internal error or
    misconfiguration and was unable to complete
    your request.</p>
    <p>Please contact the server administrator,
    webmaster @ dailysurveys4u.com and inform them of the time the error occurred,
    and anything you might have done that may have
    caused the error.</p>
    <p>More information about this error may be available
    in the server error log.</p>
    <p>Additionally, a 404 Not Found
    error was encountered while trying to use an ErrorDocument to handle the request.</p>
    <hr>
    <address>Apache/2.0.63 (Unix) mod_ssl/2.0.63 OpenSSL/0.9.8e-fips-rhel5 mod_auth_passthrough/2.1 mod_bwlimited/1.4 FrontPage/5.0.2.2635 Server at ---</address>
    </body></html>
    I am guessing there is a time limit on running a PHP file from a Cron?

    I am at a VPS with WHM and cPanel available.

    How can I remove that time limit? (if there is one of course)

    thanks

  2. #2
    cPanel Staff cPanelTristan's Avatar
    Join Date
    Oct 2010
    Location
    somewhere over the rainbow
    Posts
    6,305
    cPanel/Enkompass Access Level

    Root Administrator

    Default Re: CRON JOB Timing Out [500 Internal Server Error]

    What are the limits you have for these values in /usr/local/lib/php.ini file (or a local php.ini if the account is using one of those):

    max_execution_time
    max_input_time
    session.gc_maxlifetime

    Thanks.
    cPResources: Support Options | More Support Options | Forums Search | cPanel.net Site Search | Mailing Lists(Alt) | Docs
    -- Tristan, Forums Technical Analyst, cPanel Tech Support

    Submit a ticket | Check an existing ticket

  3. #3
    Registered User
    Join Date
    Aug 2010
    Posts
    4

    Default Re: CRON JOB Timing Out [500 Internal Server Error]

    max_execution_time = 99999999
    max_input_time = 60
    session.gc_maxlifetime = 1440

    I changed the max_execution_time yesterday after that happened. Haven't tried to run it again cause I splitted the script to smaller ones tha run for abour 5 minutes each.

    It is strange though that session.gc_maxlifetime is 1440 seconds which equals 24 minutes, really close to the time my script run(about 25 minutes) before getting this error.....

  4. #4
    cPanel Staff cPanelTristan's Avatar
    Join Date
    Oct 2010
    Location
    somewhere over the rainbow
    Posts
    6,305
    cPanel/Enkompass Access Level

    Root Administrator

    Default Re: CRON JOB Timing Out [500 Internal Server Error]

    Yes, that is the one I was thinking was the issue and why I included it in the post for evaluation on the time it had available. It's the garbage collection maximum lifetime before clearing collection. I would increase it personally to a higher value.
    cPResources: Support Options | More Support Options | Forums Search | cPanel.net Site Search | Mailing Lists(Alt) | Docs
    -- Tristan, Forums Technical Analyst, cPanel Tech Support

    Submit a ticket | Check an existing ticket

Similar Threads & Tags
Similar threads

  1. 500 Internal Server Error
    By crazyaboutlinux in forum New User Questions
    Replies: 4
    Last Post: 04-06-2009, 07:36 AM
  2. Cron Job Timing Question....
    By Nhojohl in forum cPanel and WHM Discussions
    Replies: 3
    Last Post: 04-05-2007, 11:02 PM
  3. 500 Internal Server Error
    By Doctor in forum cPanel and WHM Discussions
    Replies: 1
    Last Post: 05-17-2006, 05:10 AM
  4. (HELP!!) 500 Internal Server Error
    By p3.ter in forum cPanel and WHM Discussions
    Replies: 4
    Last Post: 11-24-2004, 12:09 AM
  5. Internal Server Error 500
    By ukpro in forum cPanel and WHM Discussions
    Replies: 2
    Last Post: 10-07-2004, 09:30 AM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube