PHP script timed out before returning headers
I was working with DirectAdmin and this time it was set to use suPHP (for some weird reason). Anyway, when trying to run a PHP script from the Drupal site, it returned an error: “Script timed out before returning header”.
Looks like suPHP ignores php.ini, so I needed to increase the timeout in Apache configuration, with the following steps:
vim /etc/httpd/conf/extra/httpd-default.conf
Now, update the following line:
Timeout 60
To your own value:
Timeout 300
Don’t forget to restart apache:
systemctl restart httpd
Related Articles
Custom Apache Handler for Running Multiple PHP Versions Per VirtualHost
How to run multiple PHP versions side-by-side in Apache VirtualHosts using PHP-FPM Unix sockets (Apache 2.4+) or CGI ScriptAlias handlers.
Mautic & GCP: Automate Database Password Rotation with Secrets Manager
Automate Cloud SQL database password rotation in Mautic on GCP using Google Cloud Secret Manager and local TTL caching.
RDP to Azure VM from Linux
How to RDP to Azure VM from Linux