How To Fix WordPress Gateway Timeout Errors Running Apache with PHP-FPM
PROBLEM:
I was seeing the following error when trying to do a plugin update, and an error in my WordPress logs:
Update failed: 504 Gateway Timeout Gateway Timeout The gateway did not receive a timely response from the upstream server or application.
[Tue Apr 11 22:12:01.373709 2023] [proxy_fcgi:error] [pid 26878] (70007)The timeout specified has expired: [client 200.10.125.161:55460] AH01075: Error dispatching request to : (polling), referer: https://www.demo.org/wp-admin/plugins.php?plugin_status=upgrade
and getting variations of any of the following strings:
504 Gateway Timeout
HTTP 504
504 ERROR
Gateway Timeout (504)
HTTP Error 504 – Gateway Timeout
Gateway Timeout Error
SOLUTION:
1 2 3 4 5 6 7 8 9 10 11 |
vi /etc/httpd/conf.d/php.conf ADD: <Proxy "unix:/run/php-fpm/www.sock|fcgi://localhost"> ProxySet connectiontimeout=1200 TimeOut=1200 </Proxy> vi /etc/httpd/conf.modules.d/00-proxy_timeout.conf Timeout 1200 ProxyTimeout 1200 systemctl restart php-fpm systemctl restart httpd ~OR~ apachectl configtest;apachectl restart |
Leave Your Comment
All fields marked with "*" are required.