Skip to content
  • Solutions
    By Role
    • For Developers
    • For Content Managers
    • For Agencies
    • For IT Admins
    • For Web Hosters
    • For Developers
    • For Content Managers
    • For Agencies
    • For IT Admins
    • For Web Hosters
    By Infrastructure
    • Overview
    • AWS
    • Microsoft Azure
    • Alibaba Cloud
    • Google Cloud Platform
    • Vultr
    • Overview
    • AWS
    • Microsoft Azure
    • Alibaba Cloud
    • Google Cloud Platform
    • Vultr
    • Digital Ocean
    • Linode
    • Upcloud
    • Oracle
    • OVH
    • Digital Ocean
    • Linode
    • Upcloud
    • Oracle
    • OVH
  • Product
    • Plesk Features
    • Plesk Editions
    • What’s new
    • Pricing
    • Roadmap
    • Lifecycle Policy
    • Extensions Catalogue
  • Pricing
  • Extensions
    Featured Extensions
    • SocialBee
    • WP Toolkit
    • Sitejet Builder for Plesk
    • SEO Toolkit
    • Joomla! Toolkit
    • Premium Email
    • Email Security
    • SocialBee
    • WP Toolkit
    • Sitejet Builder for Plesk
    • SEO Toolkit
    • Joomla! Toolkit
    • Premium Email
    • Email Security
    Bundles and packs:
    • Business and Collaboration Edition
    • WP pack
    • Hosting pack
    • Power pack
    • Language pack
    • Business and Collaboration Edition
    • WP pack
    • Hosting pack
    • Power pack
    • Language pack

    See all Extensions

  • For Partners
    • Plesk Contributor Program
    • Plesk Partner Program
    • Affiliate program
    • Plesk University
  • Help Center
    • Documentation
    • Professional Services
    • Support
    • Contact Us
    • Wiki
    • Forum
  • Plesk 360 login
  • Free Trial
  • Pricing
  • Solutions
    • By Role
      • For Developers
      • For Content Managers
      • For Agencies
      • For IT Admins
      • For Web Hosters
    • By Infrastructure
      • Overview
      • Plesk on Amazon Web Services (AWS & Lightsail)
      • Microsoft Azure
      • Alibaba Cloud
      • Google Cloud Platform
      • Vultr
      • DigitalOcean
      • Linode
      • UpCloud
      • Oracle
      • OVH
  • Products
  • Pricing
  • Extensions
    • Featured Extensions
      • SocialBee
      • WP Toolkit
      • Sitejet Builder for Plesk
      • SEO Toolkit
      • Joomla! Toolkit
      • Premium Email
      • Email Security
    • Bundles and packs:
      • Business and Collaboration Edition
      • WP pack
      • Hosting pack
      • Power pack
      • Language pack
      • See all Extensions
  • For Partners
    • Plesk Contributor Program
    • Plesk Partner Program
    • Affiliate Program
    • Plesk University
  • Help Center
    • Documentation
    • Professional Services
    • Support
    • Contact Us
    • Wiki
    • Forum
  • Plesk 360 login
  • Free Trial
  • Pricing
  • Solutions
    • By Role
      • For Developers
      • For Content Managers
      • For Agencies
      • For IT Admins
      • For Web Hosters
    • By Infrastructure
      • Overview
      • Plesk on Amazon Web Services (AWS & Lightsail)
      • Microsoft Azure
      • Alibaba Cloud
      • Google Cloud Platform
      • Vultr
      • DigitalOcean
      • Linode
      • UpCloud
      • Oracle
      • OVH
  • Products
  • Pricing
  • Extensions
    • Featured Extensions
      • SocialBee
      • WP Toolkit
      • Sitejet Builder for Plesk
      • SEO Toolkit
      • Joomla! Toolkit
      • Premium Email
      • Email Security
    • Bundles and packs:
      • Business and Collaboration Edition
      • WP pack
      • Hosting pack
      • Power pack
      • Language pack
      • See all Extensions
  • For Partners
    • Plesk Contributor Program
    • Plesk Partner Program
    • Affiliate Program
    • Plesk University
  • Help Center
    • Documentation
    • Professional Services
    • Support
    • Contact Us
    • Wiki
    • Forum
  • Plesk 360 login
  • Free Trial
Plesk 360 login
Free Trial

Knowledge Base

Unable to access PHP application with 504 Gateway Time-out error: upstream timed out (110: Connection timed out) while reading response header

 
developerhttphttpsnginxphp

Symptoms

  • Unable to access a PHP script on a website such as https://example.com/app/script.php with 504 Gateway Time-out error showing up in the browser

  • The following error shows up in the nginx error log /var/www/vhosts/system/example.com/logs/proxy_error_log for the website:

    [error] 4853#0: *21 upstream timed out (110: Connection timed out) while reading response header from upstream, client: 203.0.113.2, server: example.com, request: "GET /app/script.php HTTP/2.0", upstream: "https://203.0.113.3:7081/app/updateprice.php", hos t: "example.com"

  • Increasing the time out values as explained here does not help

  • If you place a diagnostic phpinfo.php file in the main directory of the website and try to open it, it loads right away

Cause

The PHP script loads that should be loaded is either loading infinitely (or above 15 minutes) or not exiting properly and causes an infinite loading loop. This usually happens when using a poorly or incorrectly written PHP script.

Resolution

Contact the PHP app or website developer in order to have the script code reviewed and optimized.

Check for how long exactly the script runs via these steps

  1. Connect to the server via SSH

  2. Run the following command to execute PHP script behalf subscriber's user:

    # time sudo -H -u jdoe bash -c "/opt/plesk/php/8.0/bin/php /var/www/vhosts/example.com/httpdocs/app/script.php"

    Note: Change the PHP version, Subscription system user and exact script path as necessary.

  3. Check the last lines of the output, would be something like:

    real 15m11.605s
    user 0m0.117s
    sys 0m0.224s

Note: In the example above case, the script ran for more than 15 minutes, which is a clear sign that it has been written poorly.

Tweet
Share
Share
Email
0 Shares
Read the full article
Related Posts

Ruby on Rails vs PHP: Which one’s right for your needs?

Read More »

NGINX vs Apache – Which Is the Best Web Server in 2024?

Read More »

NGINX Configuration Guide

Read More »
Knowledge Base

“View the phpinfo() page” button in Plesk does not work: Error: Unable to retrieve information about the PHP configuration

Read More »

Websites on Plesk server are slow or show error 500 or PHP mail cannot be sent: ap_pass_brigade failed

Read More »

RoundCube shows error when sending email with attachment: An error occurred: Request timed out

Read More »

How to allow access to a website directory from specific IP address in Plesk?

Read More »

Hosting Wiki

  • Server Redundancy
  • Bare Metal Server
  • PhpMyAdmin
  • phpPgAdmin
  • Oracle VM Server
  • Server Virtualization Software
  • Windows Server
  • Linux
  • PHP
  • HTTP/3
  • HTTP/2
  • Plesk
  • Lighttpd
  • NGINX
  • Web Server
  • DNS Server
  • SSH
  • HTTP
X-twitter Linkedin Youtube Reddit Github
  • Product
  • Login
  • Pricing
  • Editions
  • For Partners
  • Partner Program
  • Contributor Program
  • Affiliate Program
  • Plesk University
  • Company
  • Blog
  • Careers
  • Events
  • About Plesk
  • Our Brand
  • Resources
  • User and Admin guides
  • Help Center
  • Migrate to Plesk
  • Contact Us
  • Hosting Wiki
  • Forum
  • Legal
  • Legal
  • Privacy Policy
  • Imprint

© 2025 WebPros International GmbH

Part of the WebPros®  Family