Skip to main content Scroll Top

15 Website Errors Every Developer Runs Into (And How to Actually Fix Them)

15 common website errors — from WordPress 500 error to CORS and database issues — explained with real causes and step-by-step fixes.

errors

Some errors show up so often that they’ve basically become a rite of passage — every WordPress dev has stared at a blank white screen at least once. This post rounds up the most common website and server errors, why they actually happen, and the fix that works (not just “clear your cache and pray”).

WordPress Errors

1. 500 Internal Server Error

Why it happens: Usually a corrupted .htaccess file, a plugin/theme conflict, or a PHP memory limit that’s too low — ironically, this often shows up right after someone increases max_execution_time and the server’s PHP config doesn’t actually allow the new value.

Fix:

  • Rename .htaccess to .htaccess_old and let WordPress regenerate it (Settings → Permalinks → Save).
  • Deactivate all plugins via FTP (rename the plugins folder) and reactivate one by one.
  • Check wp-config.php for define('WP_MEMORY_LIMIT', '256M'); and raise it if needed.
  • If you edited max_execution_time in .htaccess or php.ini, confirm your host actually allows overriding it — some hosts silently reject values above a hard cap.

Read Full blog

2. White Screen of Death (WSOD)

Why it happens: A PHP fatal error that WordPress isn’t configured to display, usually from a plugin/theme code error or exhausted memory.

Fix:

  • Turn on debug mode in wp-config.php:

php

  define('WP_DEBUG', true);
  define('WP_DEBUG_LOG', true);
  define('WP_DEBUG_DISPLAY', false);
  • Check wp-content/debug.log for the actual error and file/line number.
  • Disable plugins/switch to a default theme (e.g., Twenty Twenty-Four) to isolate the cause.

Read Full Blog

3. “Error Establishing a Database Connection”

Why it happens: Wrong DB credentials in wp-config.php, a corrupted database, or the DB server itself is down/overloaded.

Fix:

  • Double-check DB_NAME, DB_USER, DB_PASSWORD, DB_HOST in wp-config.php.
  • Try connecting to the database directly via phpMyAdmin/CLI to confirm it’s actually reachable.
  • If credentials are correct, the table might need repair: add define('WP_ALLOW_REPAIR', true); to wp-config.php and visit /wp-admin/maint/repair.php.

Read Full Blog

4. 413 Request Entity Too Large (upload fails)

Why it happens: The web server (Nginx/Apache) or PHP’s upload limits are smaller than the file being uploaded.

Fix:

  • In php.ini: increase upload_max_filesize and post_max_size.
  • For Nginx, add client_max_body_size 64M; inside the server block.
  • For Apache, add to .htaccess:

apache

  php_value upload_max_filesize 64M
  php_value post_max_size 64M

Read Full Blog

5. Syntax Error After Editing functions.php

Why it happens: A missing semicolon, unmatched bracket, or stray character — and because it’s PHP, one typo takes the whole site down.

Fix:

  • Access the file via FTP/File Manager (not the WP admin editor, since the site is likely down) and fix or remove the last change.
  • Always edit functions.php locally or in a staging environment first, never directly in production.

Read Full Blog

6. Mixed Content Errors (site loads, but “not secure”)

Why it happens: Some resources (images, scripts, CSS) are still being loaded over http:// while the rest of the site is on https://.

Fix:

  • Search the database for hardcoded http:// URLs and replace them with https:// (a search-replace plugin or WP-CLI’s wp search-replace command works well).
  • Make sure the siteurl and home values in Settings → General both use https://.

Read Full Blog

7. Too Many Redirects (ERR_TOO_MANY_REDIRECTS)

Why it happens: Conflicting redirect rules — often an SSL plugin fighting with server-level HTTPS redirection, or siteurl/home mismatched with the actual domain.

Fix:

  • Temporarily disable any SSL/redirect plugins and see if the loop stops.
  • Check .htaccess for duplicate RewriteRule redirect blocks.
  • Confirm siteurl and home in the database match exactly (protocol included).

Read Full Blog

8. “Allowed Memory Size Exhausted”

Why it happens: A plugin or theme is using more memory than PHP is allowed to allocate.

Fix:

  • Raise the limit in wp-config.php: define('WP_MEMORY_LIMIT', '256M');
  • If that doesn’t help, the real fix is finding which plugin is memory-hungry — deactivate in batches to isolate it, since raising the limit is a band-aid, not a cure.

Read Full Blog


General Server Errors

9. 502 Bad Gateway vs. 504 Gateway Timeout

Why they happen: A 502 means the upstream server (e.g., PHP-FPM) sent an invalid response to the proxy (Nginx). A 504 means the upstream server took too long to respond at all.

Fix:

  • 502: Check if PHP-FPM or the application server crashed — restart it and check its error logs.
  • 504: Look for a slow database query or external API call that’s timing out; increase the proxy timeout as a stopgap while you fix the slow process itself.

Read Full Blog

10. 403 Forbidden

Why it happens: File/folder permission issues, a misconfigured .htaccess, or a security plugin/firewall blocking the request.

Fix:

  • Standard permissions: folders 755, files 644.
  • Comment out .htaccess rules one at a time to find the blocking rule.
  • Check if a firewall (e.g., a WAF or security plugin) is flagging the IP or request.

Read Full Blog

11. SSL Certificate Errors (NET::ERR_CERT_AUTHORITY_INVALID, etc.)

Why it happens: Expired certificate, incomplete certificate chain (missing intermediate cert), or the certificate doesn’t match the domain.

Fix:

  • Renew the certificate if expired (or check if auto-renewal, e.g., Let’s Encrypt/Certbot, silently failed).
  • Reinstall the full certificate chain, not just the leaf certificate.
  • Verify with an SSL checker tool that the chain is complete.

Read Full Blog

12. CORS Policy Error (“blocked by CORS policy”)

Why it happens: The browser is blocking a cross-origin request because the server didn’t send the right Access-Control-Allow-Origin header.

Fix:

  • Add the appropriate CORS headers on the server/API responding to the request — don’t try to “fix” it from the frontend, since it’s a server-side header issue.
  • For Nginx: add_header 'Access-Control-Allow-Origin' '*'; (scope this down to specific origins in production, not *).

Read Full Blog


Database Errors

13. MySQL “Too Many Connections”

Why it happens: The app is opening more DB connections than MySQL’s max_connections allows — often from connections not being closed properly, or genuine traffic spikes.

Fix:

  • Short-term: raise max_connections in my.cnf.
  • Real fix: check for connection leaks in the application code, and consider connection pooling.

Read Full Blog

14. Deadlock Found When Trying to Get Lock

Why it happens: Two transactions are waiting on locks the other one holds — a classic concurrency issue.

Fix:

  • Add retry logic in the application for deadlock errors specifically.
  • Review transactions to keep them short and always access tables in the same order to avoid circular waits.

Read Full Blog


Git / Deployment

15. “fatal: refusing to merge unrelated histories”

Why it happens: You’re trying to merge two branches (or a local repo with a remote) that don’t share a common commit history — common when initializing a new repo that already has a remote with existing commits.

Fix:

bash

git pull origin main --allow-unrelated-histories

Then resolve any conflicts that come up like a normal merge.

Read Full Blog


The Common Thread

Almost every error on this list has the same three-step fix pattern: isolate (turn off/disable things until the problem disappears), read the actual log (not just the error message shown to the user), and fix the root cause instead of just raising a limit or restarting the server. Bookmark the log file locations for your stack — debug.log for WordPress, server error logs for Nginx/Apache — they’ll save you more time than any Stack Overflow thread.

Related Posts

Leave a comment