ErrorsTroubleshootingHTTP6 min read

Troubleshoot common hosting errors

Errors 500, 403, 404, 503, white screen, email issues and database connection problems.


Most frequent HTTP errors

This guide helps you diagnose and resolve the most common errors in shared hosting.

Error 500 - Internal Server Error

The most common error. It indicates a problem on the server or in your code.

Causes and solutions

1. Error in .htaccess:

bash
# Temporarily rename .htaccess
mv .htaccess .htaccess.bak
# If the site loads, the problem is in .htaccess

2. Incorrect permissions:

bash
# Fix permissions
find . -type f -exec chmod 644 {} \;
find . -type d -exec chmod 755 {} \;

3. PHP memory limit:

ini
; In .user.ini or php.ini
memory_limit = 256M

4. Corrupted plugin/theme (WordPress):

bash
# Rename plugins folder
mv wp-content/plugins wp-content/plugins_bak
# If it works, reactivate one by one to find the culprit

5. Check the error_log:

bash
tail -50 ~/public_html/error_log
# Or from cPanel → Metrics → Errors

Error 403 - Forbidden

The server denies access to the resource.

Causes and solutions

1. Restrictive permissions:

bash
chmod 755 public_html/
chmod 644 public_html/index.php

2. No index file:

bash
# Verify that index.html or index.php exists
ls public_html/index.*

3. Rule in .htaccess blocking access:

Check for Require or Deny from rules in .htaccess.

4. ModSecurity blocking the request:

Check in cPanel → SecurityModSecurity for blocking logs.

Error 404 - Not Found

The requested resource does not exist.

Causes and solutions

1. Incorrect URL or deleted file:

Verify that the file exists at the correct path.

2. Broken permalinks (WordPress):

  1. Go to SettingsPermalinks
  2. Without changing anything, click Save Changes
  3. This regenerates the .htaccess

3. Missing RewriteBase:

apache
# If WordPress is in a subdirectory
RewriteBase /subdirectory/

Error 503 - Service Unavailable

The server is temporarily unavailable.

Causes and solutions

1. Too many processes:

Your account exceeded the simultaneous process limit. Wait a few minutes or contact support.

2. Server maintenance:

Check the service status in the Baires Host panel.

3. .maintenance file (WordPress):

bash
# Delete maintenance file
rm ~/public_html/.maintenance

White Screen (White Screen of Death)

The site loads but displays nothing.

Solutions

1. Enable debug (WordPress):

php
// In wp-config.php
define('WP_DEBUG', true);
define('WP_DEBUG_LOG', true);
define('WP_DEBUG_DISPLAY', false);

2. Increase memory:

php
define('WP_MEMORY_LIMIT', '256M');

3. Check logs:

bash
tail -20 ~/public_html/wp-content/debug.log

Email not sending

Diagnosis

  1. Check the mail queue in cPanel → EmailTrack Delivery
  2. Verify SPF/DKIM records: dig yourdomain.com TXT +short
  3. Check if the IP is on blacklists: mxtoolbox.com/blacklists

Solutions

  • Verify that PHP mail() function is enabled
  • Use authenticated SMTP instead of mail() (plugins like WP Mail SMTP)
  • Check that you are not exceeding the hourly sending limit

Database connection error

terminal
Error establishing a database connection

Solutions

  1. Verify credentials in wp-config.php or configuration file
  2. Verify that the database exists in cPanel → MySQL Databases
  3. Verify that the user has assigned permissions
  4. Try to repair the database:
php
// In wp-config.php (temporary)
define('WP_ALLOW_REPAIR', true);
// Visit: yourdomain.com/wp-admin/maint/repair.php

Disk Quota Exceeded

Your account ran out of space.

Solutions

  1. Check usage in cPanel → sidebar → Disk Usage
  2. Delete unnecessary files:
bash
# Find large files
find ~/ -type f -size +50M -exec ls -lh {} \;

# Clean old logs
find ~/logs -name '*.log' -mtime +30 -delete

# Clean old backups
rm ~/backup-*.tar.gz
  1. Empty the cPanel trash: TrashEmpty Trash

Diagnostic tools

bash
# View active processes
ps aux | grep $USER

# View disk usage
du -sh ~/public_html/*

# View recent error logs
tail -100 ~/logs/error.log

# Verify database connectivity
mysql -u username -p -e 'SELECT 1;'

General recommendations

  • Always check the error_log as a first step
  • Make a backup before attempting solutions
  • If a change does not resolve the problem, revert it
  • Use debug mode only temporarily
  • If the problem persists, contact Baires Host support with the relevant logs

Was this guide helpful?