×


Plesk error AH01075: Error dispatching request to - Fix it Now ?

Plesk users may encounter the error "AH01075: Error dispatching request to" in the domain's error logs along with a "504 Gateway Time-out" or "503 Service Temporarily Unavailable" error on the website.

Here at Ibmi Media, as part of our Server Management Services, we regularly help our Customers to perform related Plesk error.


Nature and fixes for Plesk "AH01075: Error dispatching request to" ?

1. 503 Service Temporarily Unavailable on Plesk

Symptoms of this error include:

i. The /var/www/vhosts/example.com/logs/error_log file shows:

[proxy_fcgi:error] [pid 350:tid 139649016084224] (104)Connection reset by peer: [client 203.0.113.2:58642] AH01075: Error dispatching request to :, referer: http://example.com/wordpress/wp-admin/upload.php

ii. dmesg` command output shows:

[4289853.349670] php-cgi[49424]: segfault at 30 ip 00007fc662113088 sp 00007fc630ad3d10 error 4
[4289853.349672] in libMagickCore.so.5.0.0[7fc661f8e000+237000]

An ImageMagick library bug can cause this error.


To fix this 503 error, we disable the Imagick PHP module for PHP handler for the website:

  • To do so, we log in to Plesk.
  • Browse to Tools & Settings > PHP Settings.
  • Then click on the PHP handler that is set for the domain, e.g. PHP 5.6.
  • To disable the extension, we Uncheck the Imagick checkbox.
  • Then, we ensure that no sites are using this module.

Make note that these settings are common to the 5.6.36 CGI applications, 5.6.36 FastCGI applications. The settings apply to all websites that use these handlers.


2. 504 Gateway Time-out on website

Symptoms of this error include:

i. Website example.com is not accessible. We come across the below error in a browser:

504 Gateway Time-out

ii. In the domain error log file, Domains > example.com > Logs, we see the error:

[proxy_fcgi:error] [pid 42290:tid 140458047010560] (70007)The timeout specified has expired: [client 203.0.113.2:54693] AH01075: Error dispatching request to :, referer: http://example.com/gallery

iii. In the Plesk > Domains > example.com > PHP Settings it shows the website uses a "FastCGI application" (not an "FPM application") PHP handler.


The cause of this error can be the execution PHP code of the website takes longer than the specified timeout.

To fix the issue, we increase the timeout. We can increase the FastCGI limits for an affected domain only or on a server-wide level.

To Increase the FastCGI limits for a single domain:

i. Log into Plesk

ii. Then, go to Domains > example.com > Apache & Nginx Settings.

iii. We add the following lines to the text boxes Additional directives for HTTP and Additional directives for HTTPS:

FcgidIdleTimeout 1200
FcgidProcessLifeTime 1200
FcgidConnectTimeout 1200
FcgidIOTimeout 1200
Timeout 1200
ProxyTimeout 1200

However, if the website still shows "504 Gateway Timeout" we increase timeouts to higher values.

iv. Finally, we click OK to apply the changes.


To Increase the FastCGI limits server-wide:

i. We connect to the Plesk server via SSH as the root user.

ii. Then we open the FastCGI configuration file fcgid.conf in a text editor. The location of the file depends on the operating system:

(a) for CentOS/RHEL/CloudLinux distributions:

/etc/httpd/conf.d/fcgid.conf

(b) for Debian/Ubuntu distributions:

/etc/apache2/mods-enabled/fcgid.conf

iii. Eventually, we increase FastCGI timeout limits:

FcgidIdleTimeout 1200
FcgidProcessLifeTime 1200
FcgidConnectTimeout 1200
FcgidIOTimeout 1200

iv. If we use FPM PHP handler to create /etc/httpd/conf.modules.d/00-proxy_timeout.conf then we add the following lines into it:

Timeout 1200
ProxyTimeout 1200

v. Then we test configuration with “apachectl configtest” command. The output will be similar to:

# apachectl configtest
Syntax OK

vi. Then we restart Apache:

(a) for CentOS/RHEL-based operating systems:

# service httpd restart

(b) for Debian/Ubuntu-based operating systems:

# service apache2 restart


[Need help with fixing Plesk errors? We'd be happy to assist. ]


Conclusion

This article covers methods to resolve 504 Gateway Time-out Plesk error which happens when there is an Execution of the PHP code of the website which takes longer than the specified timeout.