FastPanel: Site Errors 500, 502, 503, 504 and Database Errors

In the examples my-site.com is your domain. First look at the error code — it is shown on the page or in the browser tab.

ErrorWhat it means
500 Internal Server Error, blank pagean error in the site's PHP code or in .htaccess
502 Bad Gatewaynginx did not get a response from the PHP handler (Apache or PHP-FPM)
503 Service Unavailablethe site's handler is temporarily unavailable or overloaded
504 Gateway Time-outa script is taking too long
"Error establishing a database connection"the site cannot connect to its database

The key tool: site logs

Site card → "Logs". For a 500 error, check the Backend error tab — it has PHP errors. For 502 and 504, check the Frontend error tab with nginx errors. Details: scheduler and logs.

Site logs in FastPanel
Site logs in FastPanel

500 and a blank page

  • PHP Fatal error in the Backend error tab — an error in the code: the file and line are shown. After a WordPress plugin update, rename the plugin folder in wp-content/plugins.
  • The site needs another PHP version — site card → "Settings" → backend: PHP version and settings.
  • .htaccess rules do not work — in PHP-FPM mode the .htaccess file has no effect, and the rules are moved to the nginx settings. If the site needs .htaccess, choose FastCGI mode.

502 and 503

nginx cannot get a response from the site's handler. Most often the PHP-FPM or Apache service has stopped; less often the process is overloaded. Services are checked and restarted in "Settings" → "Services" as the server administrator (fastuser) — FastPanel services. If you do not have this login, contact support. If the service stops again, look for the cause in the Backend error tab.

504 Gateway Time-out

A script did not respond in the allowed time: a long import, a backup made by a plugin, a heavy report. Split the operation into parts or run it on a schedule — the scheduler. The PHP execution time (max_execution_time) is set in the site's PHP settings.

Database connection error

  1. Open the site's settings file: wp-config.php (WordPress), configuration.php (Joomla), config.php (OpenCart) or .env (Laravel).
  2. Compare the database name and user with the list in "Management" → "Databases". The server (host) is localhost, port 3306.
  3. If you are not sure about the password, set a new one for the database user: "Databases" → user → "Edit". Then enter this password in the settings file.
  4. If all sites on the server show the error at once, the MySQL service has most likely stopped. It is started in "Settings" → "Services" as the server administrator (fastuser) or through support.
Database list: database name and user
Database list: database name and user

More about databases: database in FastPanel.

Questions and answers
Site card → "Logs" → Backend error tab: it has PHP errors with the file and line.
The PHP-FPM and Apache services in "Settings" → "Services" (as the server administrator fastuser): if a service has stopped, start it. Then check the Backend error tab.
In PHP-FPM mode the .htaccess file has no effect. Move the rules to the nginx settings or choose FastCGI mode.