The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

SOLVED PHP script times out at 5 minutes despite apache timeout and set_time_limit()

Discussion in 'General Discussion' started by rinkleton, Feb 23, 2017.

  1. rinkleton

    rinkleton Well-Known Member

    Joined:
    Jul 16, 2015
    Messages:
    51
    Likes Received:
    1
    Trophy Points:
    8
    Location:
    Cleveland
    cPanel Access Level:
    Root Administrator
    I have a php script that needs to run for a while. I've increased my php time limit and increased the apache timeout directive but not matter how high I set them, something times out at 5 minutes exactly. It ends up with a 503 Service Unavailable error.

    It seems like it is not PHP. I've registered a shutdown function that will send an email, but that never gets sent. I've also set it to ignore_user_abort(true), so whatever is killing it is doing so very forcefully. I thought increasing the apache timeout would do it for sure, but to no avail.

    I realize this might not be a cPanel question, but I'm wondering if I've overlooked a setting or something.
     
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    37,064
    Likes Received:
    1,286
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello,

    Do you notice any output to /usr/local/apache/logs/error_log when this happens? What PHP handler are you using for this account? Is PHP-FPM enabled on this domain name?

    Thank you.
     
  3. rinkleton

    rinkleton Well-Known Member

    Joined:
    Jul 16, 2015
    Messages:
    51
    Likes Received:
    1
    Trophy Points:
    8
    Location:
    Cleveland
    cPanel Access Level:
    Root Administrator
    Using Apache with lsapi - And it is an issue with lsapi_backend_max_process_time defaulting to 300 even though the docs say 3600. Thanks, you put me onto it!
     
  4. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    37,064
    Likes Received:
    1,286
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    I'm happy to see you were able to resolve the issue. Thank you for updating us with the outcome.
     
Loading...

Share This Page