Articles in this section

Website on Plesk server is not accessible: 504 Gateway Time-out: The timeout specified has expired: [client 203.0.113.2:54693] AH01075: Error dispatching request to

Plesk for Linux kb: technical ABT: Group A FR:PPM-1994

Applicable to:

  • Plesk for Linux

Symptoms

  • Website example.com is not accessible. The following error is shown in a browser:

    CONFIG_TEXT: 504 Gateway Time-out

  • The following error message appears in the domain error log file at Domains > example.com > Logs:

    PLESK_INFO: [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

Cause

Execution PHP code of the website takes longer than the specified timeout.

Resolution

To fix the issue increase the timeout. FastCGI limits can be increased for an affected domain only or on a server-wide level. Both ways are described below.

Note: In case it is necessary to run only one script with the increased timeout, consider running it in a scheduled task: How to schedule a task in Plesk for Linux?

Increasing the FastCGI limits for a single domain
  1. Log into Plesk

  2. In Plesk, go to Domains > example.com > Apache & nginx Settings.

  3. Add the following lines to the text boxes Additional directives for HTTP and Additional directives for HTTPS:

    CONFIG_TEXT: FcgidIdleTimeout 1200
    FcgidProcessLifeTime 1200
    FcgidConnectTimeout 1200
    FcgidIOTimeout 1200
    Timeout 1200
    ProxyTimeout 1200

    Note: If the website still shows "504 Gateway Timeout" try increasing timeouts to higher values.

  4. Click OK button to apply the changes.

Increasing the FastCGI limits server-wide
  1. Connect to the Plesk server via SSH as root user.

  2. Open the FastCGI configuration file fcgid.conf in a text editor with a text editor such as "vi" or "nano". Location of the file depend on operating system:

    • for CentOS/RHEL/CloudLinux distributions:

      CONFIG_TEXT: /etc/httpd/conf.d/fcgid.conf

    • for Debian/Ubuntu distributions:

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

  3. Increase FastCGI timeout limits as shown below:

    CONFIG_TEXT: FcgidIdleTimeout 1200
    FcgidProcessLifeTime 1200
    FcgidConnectTimeout 1200
    FcgidIOTimeout 1200

  4. Test configuration with "apachectl configtest" command, and it should return the following:

    # apachectl configtest
    Syntax OK

  5. Restart Apache:

    • for CentOS/RHEL-based operating systems:

      # service httpd restart

    • for Debian/Ubuntu-based operating systems:

      # service apache2 restart

Was this article helpful?

Comments

0 comments

Please sign in to leave a comment.