My PHP app is timing out and throwing 5xx errors

Running out of time to execute a request is the most common cause of timeouts and 5xx errors in PHP apps on App Platform. By default, App Platform allows your app 30 seconds to execute a request before timing out. You can increase this time by editing your app’s .user.ini file and setting the max_execution_time value to a higher number. user.ini files allow you to configure and override PHP settings on a per directory basis.

To increase your app’s maximum execution time, add a .user.ini file to the root of your app with the following contents:

    
        
            
max_execution_time=your_preferred_execution_time

        
    

You can set the execution time to a maximum of 100 seconds.

Dedicated egress IPs route egress (outbound) traffic from an app. To route ingress (inbound) traffic to an app, use one of App Platform’s public ingress IPs.
Add the root domain to the list of domains in the app’s settings along with the wildcard subdomain.
App Platform apps may be slow or unable to resolve .gov domains because the domain administrators have blocked DigitalOcean’s IP addresses. To fix this, you can contact the domain administrator or use a custom DNS resolver.