IT TipsOct 2, 20265 views

The complete self-fix guide for web, software, network, database and server errors

Every error message is a clue. This guide explains what each common error code means, why it happens, and how to fix it step by step.

FO

Fixspert Offical

Published about 1 hour ago

The complete self-fix guide for web, software, network, database and server errors

Error Codes and Their Solutions

Every error message is a clue. This guide explains what each common error code means, why it happens, and how to fix it step by step. It covers HTTP status codes (1xx to 5xx), application and API errors, MySQL database errors, WordPress problems, DNS and network errors, and Linux server errors. Where a problem cannot be fixed from your side, it tells you who to contact and where to read the official documentation.

Figure 1. Errors can happen at any stage of a web request

Figure 1. Errors can happen at any stage of a web request

In this guide

1. The 4-step method to fix any error

2. HTTP status codes explained (1xx, 2xx, 3xx)

3. 4xx client errors: 400, 401, 403, 404, 405, 409, 422, 429

4. 5xx server errors: 500, 502, 503, 504

5. Application and API errors

6. Database errors (MySQL and WordPress)

7. WordPress errors

8. DNS and network errors

9. Linux and server errors

10. Bonus quick reference for other codes

11. When you cannot fix it yourself: who to contact

12. Get help from Fixspert.com and full source list

1. The 4-Step Method to Fix Any Error

  1. Identify the error. Copy the exact code and message, and note the page or action that triggered it.

  2. Understand the cause. Work out which layer failed (browser, DNS/network, web server, application or database) using Figure 1.

  3. Apply the fix. Change one thing at a time so you know what worked. Back up before editing files or databases.

  4. Verify the result. Reload in a private/incognito window, clear the cache, and check the logs again.

Figure 2. Quick decision chart: what to check first

Figure 2. Quick decision chart: what to check first

Tools that make diagnosis easy

•      Browser DevTools (F12, Network tab) shows the status code of every request, as in Figure 3.

•      curl shows raw responses: curl -I https://example.com prints only the headers and status line.

•      Server logs hold the real cause of most 5xx errors. Nginx: /var/log/nginx/error.log. Apache: /var/log/apache2/error.log (or /var/log/httpd/error_log). PHP: the error_log file in your site folder.

•      DNS tools: nslookup example.com or dig example.com.

•      Hosting control panel (cPanel, Plesk and others) for logs, PHP settings and file manager.

Figure 3. Finding the failing request in browser DevTools (illustration)

Figure 3. Finding the failing request in browser DevTools (illustration)

2. HTTP Status Codes Explained

Every response from a web server begins with a three-digit status code. The first digit tells you the category. MDN Web Docs and RFC 9110 are the standard references for what each code means.

Figure 4. The five HTTP status code classes

Figure 4. The five HTTP status code classes

1xx Informational (100, 101, 102, 103)

These are interim responses, not errors. The request was received and the process continues. You will rarely see them in a browser.

Code

Message

What it means

What to do

100

Continue

Server received the headers; client may send the body.

Nothing. It is automatic.

101

Switching Protocols

Server agrees to change protocol, for example to WebSocket.

Nothing, unless a WebSocket connection fails (check proxy upgrade headers).

102

Processing

Server is still working on a long request (WebDAV).

Wait. Rare in modern sites.

103

Early Hints

Server sends hints so the browser can preload assets.

Nothing. Only relevant to performance tuning.

 

2xx Success (200, 201, 202, 204, 206)

Everything worked as expected. If the page still looks wrong, the problem is in content or code, not the request.

Code

Message

What it means

Notes

200

OK

Request succeeded.

If content is wrong, clear cache or check the application logic.

201

Created

A new resource was created (typical for POST in APIs).

Check the Location header for the new resource.

202

Accepted

Request accepted but processing is not finished.

Poll the status endpoint or wait for a callback.

204

No Content

Success with no body to return.

Normal for deletes and updates. Not a blank-page bug.

206

Partial Content

Server returned part of a file (range request).

Normal for video streaming and resumable downloads.

 

3xx Redirection (301, 302, 304, 307, 308)

These are not errors, but wrong redirects cause problems such as loops, lost SEO ranking and broken links.

Code

Message

What it means

How to handle it

301

Moved Permanently

The URL has permanently changed.

Update links and bookmarks to the new URL. Use 301 when you move a page for good.

302

Found

Temporary redirect.

Use the new URL for now. Use 302 only for temporary moves.

304

Not Modified

Your cached copy is still valid.

Use the cached copy. To force fresh content, hard refresh (Ctrl+F5).

307

Temporary Redirect

Temporary redirect; the HTTP method is preserved.

Follow the redirect. Common with HTTPS enforcement (HSTS).

308

Permanent Redirect

Permanent redirect; the HTTP method is preserved.

Update the URL. Like 301 but safe for POST requests.

 

Fixing "too many redirects" (ERR_TOO_MANY_REDIRECTS)

Clear cookies for the site, then check for conflicting rules: HTTP to HTTPS redirects in both .htaccess and a plugin, www versus non-www rules, or a CDN (such as Cloudflare) set to "Flexible" SSL while the origin also forces HTTPS. In WordPress, make sure Site URL and Home URL under Settings > General match the real address.

3. 4xx Client Errors

A 4xx code means the server understood the request but will not (or cannot) fulfil it because of something in the request itself. Start with the URL, your login, and your permissions.

400 Bad Request

The server cannot process the request because it is malformed.

Common causes

•      Invalid characters or a very long URL

•      Corrupt or oversized cookies ("Request Header Or Cookie Too Large")

•      Bad JSON body or missing headers in an API call

•      A file upload exceeding limits

How to fix it

  1. Re-type the URL and remove unusual characters.

  2. Clear cookies and cache for the site, or test in a private window.

  3. For APIs, validate the JSON and headers against the documentation (Content-Type: application/json).

  4. Check the upload size limits (upload_max_filesize, post_max_size, Nginx client_max_body_size).

  5. Run curl -i on the URL to see the raw response and message.

 

Can't fix it yourself?

If only one site returns 400 for everyone, check the server and proxy logs, or ask your host to review header size limits.

 

401 Unauthorized

Authentication is missing, wrong or expired.

Common causes

•      Not logged in or session expired

•      Wrong password, expired token or API key

•      Missing or malformed Authorization header

•      HTTP password protection (Basic Auth) on the folder

How to fix it

  1. Log in again or refresh your token.

  2. Confirm the API key or bearer token is current and copied without spaces.

  3. Check the header format, for example Authorization: Bearer <token>.

  4. Remove or update any directory password protection in your hosting panel if it should not be there.

  5. Check that the server clock is correct if you use time-limited tokens (JWT).

 

Can't fix it yourself?

If you do not own the account or API, contact the provider to reset access. Fixspert.com offers free IT help for quick questions and paid expert support when you want a specialist to diagnose it for you.

 

403 Forbidden

The server knows who you are but you do not have permission to access the resource.

Common causes

•      Wrong file or folder permissions

•      Rules in .htaccess, Nginx config or IP block lists

•      Security plugin, firewall or ModSecurity blocking the request

•      Missing index file with directory listing disabled

•      Account role lacks the required permission

How to fix it

  1. Set folders to 755 and files to 644 (see Figure 5).

  2. Check .htaccess by renaming it temporarily. If the error disappears, a rule is the cause.

  3. Check the security plugin or firewall logs and whitelist your IP if it was blocked.

  4. Make sure an index.php or index.html exists in the folder.

  5. Confirm your user role or ACL allows the action.

  6. Check ownership: files should belong to the web user (often www-data or your account user).

 

Can't fix it yourself?

If your host's firewall or ModSecurity is blocking you, ask support to check the rule ID from the audit log.

 

Figure 5. Safe permissions for Linux hosting

Figure 5. Safe permissions for Linux hosting

find /path/to/site -type d -exec chmod 755 {} \;

find /path/to/site -type f -exec chmod 644 {} \;

 

404 Not Found

The server cannot find anything at that URL.

Common causes

•      Typo in the URL, or a page that was moved or deleted

•      Case mismatch (/Image.png is not /image.png on Linux)

•      File uploaded to the wrong folder

•      Broken permalinks or missing rewrite rules

•      Missing redirects after a redesign

How to fix it

  1. Check the URL for typos and correct case.

  2. Confirm the file exists in the right folder.

  3. Add a 301 redirect from the old URL to the new one.

  4. In WordPress: Settings > Permalinks > Save Changes to rebuild rewrite rules.

  5. Apache: make sure mod_rewrite is enabled and AllowOverride All is set.

  6. Nginx: use try_files $uri $uri/ /index.php?$args; in the location block.

  7. Find broken links with Google Search Console (Pages report) or a crawler.

 

Can't fix it yourself?

Deleted pages that never existed on your server are not fixable by you. If your host's rewrite configuration is the problem, ask them to enable it.

 

405 Method Not Allowed

You used an HTTP method (GET, POST, PUT, DELETE) that the endpoint does not accept.

Common causes

•      POSTing to a static file or a URL that only accepts GET

•      Wrong endpoint or API version

•      Server or proxy blocking methods such as PUT or DELETE

•      CORS preflight (OPTIONS) not handled

How to fix it

  1. Read the endpoint documentation and use the allowed method (the Allow header lists them).

  2. Check the URL: a missing or extra slash can redirect POST to GET.

  3. Enable the method in the server or framework routing.

  4. For CORS, return the correct headers on OPTIONS requests.

 

409 Conflict

The request conflicts with the current state of the resource.

Common causes

•      Duplicate record or unique value already exists

•      Edit collision (two users updating the same item)

•      Version or state mismatch

How to fix it

  1. Check whether the item already exists before creating it.

  2. Reload the latest version and reapply the change.

  3. Use ETags or version fields to handle simultaneous edits.

  4. Read the response body; APIs usually explain the conflict.

 

422 Unprocessable Entity

The request format is valid, but the data failed validation.

Common causes

•      Missing required fields

•      Wrong data type, format or length

•      Values that break business rules

How to fix it

  1. Read the error body: it usually names the field.

  2. Fix the data format (dates, emails, numbers) and include required fields.

  3. Compare your payload against the API schema or documentation.

 

429 Too Many Requests

You hit a rate limit.

Common causes

•      Too many API calls in a short time

•      Aggressive bots or crawlers

•      Repeated login attempts

How to fix it

  1. Slow down and cache responses.

  2. Read the Retry-After header and wait that long.

  3. Implement exponential backoff (below).

  4. Ask the provider for a higher limit or a paid plan if you need volume.

  5. On your own server, tune rate-limit rules (Nginx limit_req, Cloudflare rules) if real users are blocked.

 

delay = 1

for attempt in range(5):

    r = requests.get(url)

    if r.status_code != 429:

        break

    time.sleep(int(r.headers.get('Retry-After', delay)))

    delay *= 2

 

4. 5xx Server Errors

A 5xx code means the request was probably fine but the server failed. Visitors cannot usually fix these, but site owners can. Logs are your best friend.

Figure 6. Which layer produces which 5xx error

Figure 6. Which layer produces which 5xx error

500 Internal Server Error

A generic message meaning something went wrong on the server and no specific code fits.

Common causes

•      PHP or application code error

•      Corrupt .htaccess or bad server configuration

•      Plugin, theme or update conflict

•      Exhausted PHP memory or resource limits

•      Wrong file permissions or a failed database connection

How to fix it

  1. Read the log: tail -n 50 /var/log/nginx/error.log or your host's error log viewer.

  2. Enable debugging (in WordPress, WP_DEBUG_LOG) and read wp-content/debug.log.

  3. Rename .htaccess to .htaccess.bak. If the site loads, regenerate it.

  4. Disable plugins by renaming the plugins folder, then re-enable one by one.

  5. Roll back the last change: code deploy, plugin, PHP version or update.

  6. Raise memory_limit in php.ini (for example 256M).

  7. Check PHP compatibility after a version change.

 

Can't fix it yourself?

If the log shows server-level errors you cannot edit, contact your host with the log line and time. Fixspert.com offers free IT help for quick questions and paid expert support when you want a specialist to diagnose it for you.

 

502 Bad Gateway

A gateway or proxy received an invalid or no response from the upstream server.

Common causes

•      PHP-FPM, Node or the application process crashed or is not running

•      Wrong upstream address or port in the proxy config

•      Firewall or network issue between proxy and app

•      CDN unable to reach the origin

How to fix it

  1. Check the app service: systemctl status php8.2-fpm (use your PHP version) or pm2 status.

  2. Restart it: sudo systemctl restart php8.2-fpm, then sudo systemctl reload nginx.

  3. Test the config: sudo nginx -t.

  4. Confirm the upstream address, port or socket path in the proxy config.

  5. Verify DNS and network between proxy and backend.

  6. Bypass the CDN temporarily to see if the origin works.

 

Can't fix it yourself?

If the origin is on shared hosting or a CDN outage, check the provider's status page and open a support ticket.

 

503 Service Unavailable

The server is temporarily unable to handle the request.

Common causes

•      Overload from traffic spikes, bots or an attack

•      Scheduled or stuck maintenance mode

•      Server out of CPU, memory or worker processes

•      Backend service stopped

How to fix it

  1. Check load with top or htop and free memory with free -h.

  2. In WordPress, delete the .maintenance file in the site root if it is stuck after an update.

  3. Restart stopped services and check worker limits (PHP-FPM pm.max_children).

  4. Block abusive IPs or enable caching and a CDN.

  5. Scale up resources or move to a bigger plan.

  6. Check the Retry-After header for the recommended wait.

 

Can't fix it yourself?

If your host suspended the account or the plan is over its limits, contact them or upgrade.

 

504 Gateway Timeout

The gateway did not get a response from the upstream in time.

Common causes

•      Slow database queries or heavy scripts

•      Timeout settings too low

•      Overloaded backend or slow external API

How to fix it

  1. Raise timeouts: Nginx proxy_read_timeout 120s; or fastcgi_read_timeout 120s;, PHP max_execution_time = 120.

  2. Find slow queries: SHOW FULL PROCESSLIST; and the slow query log; add indexes.

  3. Optimise or queue long-running tasks (imports, backups, reports).

  4. Add caching and check external API response times.

 

Can't fix it yourself?

Long-running timeouts on managed hosting are usually set by the provider. Ask them to raise limits or advise on optimisation.

 

5. Application and API Errors

Applications and APIs reuse HTTP codes to describe their own problems. The same number can mean a different thing than on a web server, so always read the response body as well as the code.

Code

Message

Meaning

Solution

400

Bad Request

Invalid input or missing data.

Validate input and check the API docs.

401

Unauthorized

Authentication required.

Check credentials, tokens and keys.

403

Forbidden

No permission to access.

Check roles and permissions.

404

Not Found

Resource not found.

Verify the endpoint or file path.

409

Conflict

Resource conflict.

Check for duplicates or state issues.

422

Unprocessable Entity

Validation error.

Fix data format or required fields.

500

Internal Server Error

Unexpected server error.

Check logs and fix the code.

 

JSON parsing error

The application received text that is not valid JSON, for example "Unexpected token < in JSON at position 0".

Common causes

•      Trailing commas, single quotes or unescaped characters

•      The API returned an HTML error page (such as a 404 or 500) instead of JSON

•      Empty response body

•      Wrong Content-Type header

How to fix it

  1. Print the raw response and read its first characters. < usually means HTML, not JSON.

  2. Paste the payload into a JSON validator and fix commas and quotes.

  3. Check the status code before parsing.

  4. Send Accept: application/json and set the correct Content-Type.

  5. Wrap JSON.parse in try/catch and log the raw text.

 

Can't fix it yourself?

If the third-party API returns invalid JSON, report it to the API provider.

 

6. Database Errors (MySQL and WordPress)

Database errors have their own numbers. The official MySQL error reference explains each code. Always take a backup before making changes.

Code

Meaning

Solution

1045

Access denied for user

Check username, password and privileges.

1064

Syntax error in SQL

Fix the SQL query syntax.

1049

Unknown database

Verify the database name.

1213

Deadlock found

Retry the transaction; shorten and optimise transactions.

2002

Can't connect to server

Check host, port and service status.

2006

MySQL server has gone away

Check connection settings, timeouts and packet size.

WP

Error establishing a database connection

Check DB credentials, host and permissions.

 

1045 Access denied for user

MySQL rejected the username, password or host combination.

Common causes

•      Wrong username or password (or special characters not handled)

•      User not allowed from that host

•      User lacks privileges on the database

How to fix it

  1. Test the login: mysql -u USER -p -h HOST.

  2. Fix the credentials in your app config (wp-config.php or .env).

  3. Grant access (as an admin): GRANT ALL PRIVILEGES ON dbname.* TO 'user'@'host'; FLUSH PRIVILEGES;. Prefer minimum privileges where possible.

  4. Reset the password in your hosting panel if needed.

 

Can't fix it yourself?

On shared hosting you cannot run GRANT yourself. Use the panel's MySQL Databases tool or ask support.

 

1064 Syntax error

MySQL could not parse your SQL statement.

Common causes

•      Typo, missing comma, quote or bracket

•      Using a reserved word as a column name

•      Syntax not supported by your MySQL/MariaDB version

•      Unescaped quotes in user input

How to fix it

  1. Read the error: it quotes the text near the mistake.

  2. Wrap reserved words and names in backticks.

  3. Check that quotes and parentheses match.

  4. Use prepared statements instead of building SQL from strings.

  5. Check the manual for your exact server version.

 

1049 Unknown database

The database name does not exist on the server.

Common causes

•      Typo in the database name

•      Database was never created or was deleted

•      Wrong server or environment

How to fix it

  1. List databases: SHOW DATABASES;.

  2. Correct the name in your config (prefixes are common on shared hosting).

  3. Create it if missing: CREATE DATABASE dbname;, then import your backup.

 

1213 Deadlock found

Two transactions blocked each other and MySQL rolled one back.

Common causes

•      Transactions locking rows in different orders

•      Long-running transactions

•      Missing indexes causing wide locks

How to fix it

  1. Retry the transaction (this is the standard fix).

  2. Keep transactions short and access tables and rows in a consistent order.

  3. Add indexes to the columns used in WHERE and JOIN.

  4. Inspect details with SHOW ENGINE INNODB STATUS;.

 

2002 Can't connect to server

The client cannot reach MySQL at the given host or socket.

Common causes

•      MySQL service is stopped

•      Wrong host, port or socket path

•      Firewall or bind-address blocking remote connections

How to fix it

  1. Check the service: sudo systemctl status mysql (or mariadb) and start it.

  2. Try 127.0.0.1 instead of localhost (or the reverse) to switch between TCP and socket.

  3. Confirm the port (default 3306): nc -vz HOST 3306.

  4. Open the firewall and review bind-address for remote access.

 

Can't fix it yourself?

For a managed database, check the provider dashboard for outages or IP allow-lists.

 

2006 MySQL server has gone away

The connection was dropped before or during the query.

Common causes

•      wait_timeout expired on an idle connection

•      Query or packet larger than max_allowed_packet

•      Server restarted or crashed

How to fix it

  1. Check limits: SHOW VARIABLES LIKE 'max_allowed_packet'; and wait_timeout.

  2. Increase them, for example SET GLOBAL max_allowed_packet=67108864;, and set them permanently in my.cnf.

  3. Reconnect on failure in your code.

  4. Check the MySQL error log and system memory for crashes (see the OOM section).

 

WordPress: Error establishing a database connection

WordPress could not connect to its database. It is caused by wrong credentials, a stopped MySQL service, or a corrupted database.

  1. Open wp-config.php and check DB_NAME, DB_USER, DB_PASSWORD and DB_HOST.

  2. Confirm the values in your hosting panel and test with the same login.

  3. Check that MySQL is running (or ask your host).

  4. Repair tables: add define('WP_ALLOW_REPAIR', true); to wp-config.php, visit /wp-admin/maint/repair.php, and remove the line afterwards, because that page needs no login.

  5. Restore from a recent backup if tables are badly damaged.

 

Can't fix it yourself?

If credentials are correct and the host says MySQL is fine, the database may be corrupt or over quota. Get a specialist to inspect it. Fixspert.com offers free IT help for quick questions and paid expert support when you want a specialist to diagnose it for you.

7. WordPress Errors

Most WordPress problems are caused by plugins, themes, memory limits or permalinks. Turn on debugging first.

define('WP_DEBUG', true);

define('WP_DEBUG_LOG', true);

define('WP_DEBUG_DISPLAY', false);

Errors are written to wp-content/debug.log. Turn debugging off when you finish.

404 Page not found

•      Go to Settings > Permalinks and click Save Changes.

•      Check .htaccess is writable and contains the WordPress rewrite block.

•      Confirm the post is published and its slug is correct.

500 Internal Server Error

•      Enable debug mode and read the log.

•      Rename the plugins folder over FTP; if the site returns, rename it back and rename plugin folders one at a time.

•      Switch to a default theme (rename the active theme folder).

•      Increase memory: define('WP_MEMORY_LIMIT', '256M');.

Database error

See the section "Error establishing a database connection" in Section 6.

White screen (White Screen of Death)

•      Increase PHP memory with WP_MEMORY_LIMIT and memory_limit.

•      Enable debug mode to reveal the fatal error.

•      Disable plugins and switch to a default theme.

•      Check that your PHP version is compatible with your theme and plugins.

Plugin and theme conflicts

•      Deactivate all plugins, then reactivate them one by one, testing after each.

•      Switch to a default theme such as Twenty Twenty-Four to test.

•      Test updates on a staging copy before applying them live.

•      Check the plugin's support forum on WordPress.org for known issues.

Can't get in to your dashboard?

Use FTP or your host's file manager to rename folders as above, or ask your host for a backup restore. Fixspert.com offers free IT help for quick questions and paid expert support when you want a specialist to diagnose it for you.

8. DNS and Network Errors

These errors appear as browser messages rather than three-digit codes. They mean the browser could not find or reach the server at all.

DNS_PROBE_FINISHED_NXDOMAIN 

The domain name does not resolve to an address.

Common causes

•      Domain expired, unregistered or mistyped

•      Wrong nameservers or missing DNS records

•      DNS changes not yet propagated (can take up to 24 to 48 hours)

•      Corrupt local DNS cache or a bad DNS server

How to fix it

  1. Check the spelling and confirm the domain is registered and not expired (WHOIS lookup).

  2. Verify nameservers and the A/AAAA/CNAME records at your registrar or DNS host.

  3. Flush your DNS cache: Windows ipconfig /flushdns; macOS sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder; Linux resolvectl flush-caches.

  4. Switch to public DNS such as 1.1.1.1 or 8.8.8.8.

  5. Test with nslookup yourdomain.com and restart your router.

 

Can't fix it yourself?

If records are correct and it still fails after propagation, contact your domain registrar or DNS provider.

 

ERR_CONNECTION_TIMED_OUT 

The server took too long to respond to the connection attempt.

Common causes

•      Server is down or unreachable

•      Firewall, VPN or proxy blocking traffic

•      Unstable internet connection

•      Server ports closed or wrong IP

How to fix it

  1. Test another site to rule out your own connection.

  2. Disable VPN or proxy and check firewall or antivirus rules.

  3. Check server reachability: ping HOST, traceroute HOST (tracert on Windows), and nc -vz HOST 443.

  4. Restart your router and modem.

  5. If it is your server, check that the web service is running and that ports 80 and 443 are open.

 

Can't fix it yourself?

If only your site fails for everyone, check your host's status or ask support to review firewall rules.

 

ERR_NAME_NOT_RESOLVED 

The browser could not translate the domain name into an IP address.

Common causes

•      Mistyped domain or missing DNS record

•      DNS server problem

•      Offline or misconfigured network

How to fix it

  1. Check the spelling of the domain.

  2. Flush the DNS cache and try another DNS server.

  3. Confirm you are online, and try a different network or device.

  4. Check that DNS records exist for the domain and the hostname.

 

9. Linux and Server Errors

Permission denied 

The user or process does not have the right to read, write or execute a file.

Common causes

•      Wrong file mode or owner

•      Parent folder not traversable

•      SELinux or AppArmor restrictions

How to fix it

  1. Inspect with ls -l and namei -l /full/path/to/file.

  2. Fix ownership: sudo chown -R www-data:www-data /var/www/site.

  3. Fix permissions: 755 for folders, 644 for files. Avoid 777.

  4. If it is SELinux, check getenforce and the audit log instead of disabling it.

 

Too many open files 

A process reached its limit on open file descriptors.

Common causes

•      Low ulimit defaults under heavy traffic

•      File or connection leaks in the application

How to fix it

  1. Check the current limit: ulimit -n.

  2. Raise it in /etc/security/limits.conf (* soft nofile 65535).

  3. For systemd services, set LimitNOFILE=65535 in the unit file and restart it.

  4. For Nginx, raise worker_rlimit_nofile and worker_connections.

  5. Find leaks with lsof -p PID | wc -l.

 

Out of memory (OOM)

The system ran out of RAM and the kernel killed a process.

Common causes

•      Too many PHP or database processes

•      Memory leaks

•      Too little RAM or no swap

How to fix it

  1. Check memory: free -h, and the kill event: dmesg | grep -i "out of memory".

  2. Find heavy processes with top or htop.

  3. Lower memory settings (PHP-FPM pm.max_children, MySQL buffers).

  4. Add swap as a safety net (below).

  5. Upgrade the plan or add RAM if usage is normal.

 

Can't fix it yourself?

If a managed or shared server keeps running out of memory, ask your host to review resource usage or move you to a larger plan.

 

sudo fallocate -l 2G /swapfile

sudo chmod 600 /swapfile

sudo mkswap /swapfile

sudo swapon /swapfile

 

502 and 503 on Nginx or Apache

See Section 4. Check systemctl status nginx (or apache2), test the configuration with nginx -t or apachectl configtest, and verify the upstream service is running.

10. Bonus Quick Reference: Other Codes You May Meet

Code

Name

Quick fix

408

Request Timeout

Retry; check slow connection or client upload speed.

410

Gone

Resource removed permanently. Remove links or redirect.

413

Content Too Large

Reduce file size or raise client_max_body_size / upload_max_filesize.

414

URI Too Long

Shorten the URL or send data with POST.

415

Unsupported Media Type

Send the correct Content-Type.

451

Unavailable For Legal Reasons

Blocked for legal reasons; not fixable by you.

501

Not Implemented

Server does not support the method; check server or framework.

507

Insufficient Storage

Free disk space or increase quota.

508

Loop Detected

Fix circular rules or symlinks.

511

Network Authentication Required

Log in to the captive portal (Wi-Fi sign-in).

520

Web Server Returned an Unknown Error (Cloudflare)

Check origin logs and crashes; review Cloudflare docs.

521

Web Server Is Down (Cloudflare)

Start the origin server and allow Cloudflare IPs.

522

Connection Timed Out (Cloudflare)

Check origin reachability and firewall.

523

Origin Is Unreachable (Cloudflare)

Check DNS record for the origin IP and routing.

524

A Timeout Occurred (Cloudflare)

Optimise slow requests or raise the origin timeout.

MySQL 1040

Too many connections

Close idle connections; raise max_connections.

MySQL 1054

Unknown column

Fix the column name or run the missing migration.

MySQL 1062

Duplicate entry

Remove the duplicate or use ON DUPLICATE KEY UPDATE.

MySQL 1146

Table doesn't exist

Check the table name or restore/import it.

MySQL 1205

Lock wait timeout

Shorten transactions and find the blocking query.

11. When You Cannot Fix It Yourself: Who to Contact

Some errors are outside your control. Use this table to find the right place to get help, and gather the exact error, the time, the URL and any log lines before you ask.

Situation

Contact

What to send

5xx on shared or managed hosting

Your hosting provider support

Error code, time, URL, error log lines

Domain not resolving, expired or wrong nameservers

Domain registrar or DNS provider

Domain name, DNS records, when you changed them

CDN error (Cloudflare 52x, 502)

CDN dashboard, status page and support

Ray ID, time, origin IP

Third-party API returns 401, 429 or 500

The API provider's docs, status page and support

Request ID, endpoint, timestamp

Database corrupt or over quota

Host support or a database specialist

Error log, database size, recent changes

Hacked site or malware suspected

Security specialist and host

Access logs, list of changed files

Errors you cannot diagnose or fix in time

Fixspert.com

The error message, screenshots and what you already tried

12. Get Help from Fixspert.com

Fixspert.com: Your Online IT Support Partner

Fixspert.com: Your Online IT Support Partner

You have tried the steps in this guide and the error is still there. That is when a second pair of eyes saves the most time. Fixspert.com is an online IT support partner for people and businesses who want problems solved quickly and correctly.

What you get at Fixspert.com

•      Free IT Help: describe your problem and get guidance on websites, computers, networks, software and more.

•      Paid expert support: when you want a specialist to diagnose and fix the issue for you.

•      AdSense Self Checker tool: check whether your website is ready for Google AdSense and catch policy and content issues before you apply.

•      IT issues covered: website and server troubleshooting, computer and laptop support, network and security solutions, software and application help, cybersecurity and data recovery.

•      Fast, reliable and professional service to get you back online.

 

Next step

Visit Fixspert.com, choose Get IT Help / Support, and send the error code, a screenshot and the steps you have already tried. The more detail you give, the faster the fix.

Official sources and further reading

Links were compiled from well-known official documentation. Please open them to confirm the latest versions.

•      MDN: HTTP status codes: https://developer.mozilla.org/en-US/docs/Web/HTTP/Status  Plain-language reference for every status code.

•      RFC 9110: HTTP Semantics: https://www.rfc-editor.org/rfc/rfc9110  The official standard.

•      IANA HTTP Status Code Registry: https://www.iana.org/assignments/http-status-codes  Complete list of registered codes.

•      MySQL error reference: https://dev.mysql.com/doc/mysql-errors/8.0/en/  All MySQL server and client error codes.

•      WordPress: Debugging: https://wordpress.org/documentation/article/debugging-in-wordpress/  How to use WP_DEBUG.

•      Nginx documentation: https://nginx.org/en/docs/  Configuration, timeouts and logging.

•      Apache HTTP Server documentation: https://httpd.apache.org/docs/  `.htaccess`, mod_rewrite and logs.

•      Cloudflare HTTP status codes: https://developers.cloudflare.com/support/troubleshooting/http-status-codes/  520 to 524 and other CDN errors.

•      Chrome DevTools: Network: https://developer.chrome.com/docs/devtools/network  How to inspect requests.

Error Codes and Their Solutions  |  Fixspert.com  

Need help with an IT issue?

File a complaint and get matched with a vetted engineer.

    The complete self-fix guide for web, software, network, database and server errors