Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

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:
    93
    Likes Received:
    3
    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 Technical Support Community Manager
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    45,214
    Likes Received:
    1,937
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    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.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. rinkleton

    rinkleton Well-Known Member

    Joined:
    Jul 16, 2015
    Messages:
    93
    Likes Received:
    3
    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 Technical Support Community Manager
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    45,214
    Likes Received:
    1,937
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    I'm happy to see you were able to resolve the issue. Thank you for updating us with the outcome.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice