Skip to content
New: Laravel Hosting, Node.js Hosting & GitHub DeploysSee the plans →
Products
Solutions
Developers

Guides

Fix a 403, 500 or database connection error on your site

What each error actually means, the order to check causes in, and the fixes for the handful of problems behind almost every broken site.

Introduction

This guide explains what each of these errors means and which causes to check first, in the order most likely to find the problem.

Database Connection Errors

WordPress reports this as “Error establishing a database connection”, and other applications phrase it differently. In every case, the site’s code is running but cannot reach its database. This is a configuration problem and does not mean your data is lost.

Check the following in order:

  1. The credentials. The database name, username, and password in your application’s configuration (wp-config.php for WordPress, .env for Laravel) must match the panel’s Databases page. If the password was recently changed in the panel, the configuration may still hold the old one.
  2. The host. The host must be localhost, not 127.0.0.1. Sites run in their own containers, and inside a container 127.0.0.1 is an empty loopback with no database on it. localhost routes through the socket your site is allowed to use. This setting explains most cases where the credentials are correct but the connection fails.
  3. The container. Your site’s overview page in the panel has a Restart container quick link. If the configuration is correct and the site still will not connect, restart the container and check again.

403 Forbidden

A 403 means the server understood the request and refused it. The usual causes are:

  • A missing index file. A directory without an index.php or index.html file returns a 403 rather than listing its contents. If you just uploaded a site, confirm the files are in public_html itself and not in a folder inside it.
  • The IP manager. Your site’s Security page may allow or block visitors by IP address, and a block rule broader than intended returns a 403 to real visitors.
  • .htaccess rules. Deny rules, country blockers, and security plugins all write to .htaccess. Rename the file to .htaccess.off and reload. If the site returns, the problem is a line in that file, and you may restore it section by section.

500 Internal Server Error

A 500 means something in your site’s code or configuration crashed while handling the request. The page visitors see is deliberately vague, but the cause is logged. The usual causes are:

  • .htaccess rules, especially after a move. Directives copied from another host often reference modules or handlers that do not exist here. Handler lines from old cPanel setups can stop PHP from executing at all. Rename the file, reload, and restore it in pieces as described above.
  • A PHP version mismatch. Old code on a new PHP version, or new code on an old one, crashes on startup. Your site’s PHP version is shown on its overview page and may be changed with one click. The PHP version guide covers how to test a change safely.
  • A plugin or theme on WordPress. If the error started right after installing or updating something, that item is the likely cause. You may use WP-CLI over SSH to disable plugins without the admin panel. Run wp plugin deactivate --all, then reactivate them one at a time.
  • Exhausted limits. A site that fails only on heavy pages, large uploads, or long imports is hitting a PHP memory or execution limit.

A Site Showing a 404

If the domain suddenly serves nothing and there is an unpaid invoice on the account, check your billing before debugging DNS. Suspended hosting stops serving, and paying the invoice restores it.

Contacting Support

If the site is still not working after these checks, open a ticket from the client area with the exact error and what you last changed. The error logs on our side usually name the failing line.

Keep reading

Other guides

Start building today

Laravel apps with queues and Horizon, WordPress stores, Node.js servers. One container with SSH, deploys from GitHub and people who answer. One bill a year.

Launch my site