500 Internal Server Error is sitting on your screen and you’ve hit refresh three times, hoping it clears itself. It won’t. Error 500 is your server telling you something crashed on the backend — a script, a database connection, a permissions rule, or a bad deploy — and refreshing just re-runs the same broken request. No amount of waiting fixes a misconfigured .htaccess file or a PHP fatal error sitting in your logs. The good news: this is one of the faster errors to diagnose because your logs almost always name the exact culprit. Give it two minutes and you’ll know whether you’re looking at a permissions issue, a plugin conflict, or a dead upstream connection.
Key Takeaways
- Error 500 never fixes itself—it signals a server-side problem requiring immediate investigation and action.
- PHP error logs contain the root cause in most cases; check them before attempting any fixes.
- Deactivating all plugins resolves the majority of Error 500 issues on WordPress sites quickly.
- Memory exhaustion and PHP version incompatibility are common culprits hiding in server logs.
- Verify the fix by clearing cache and reloading the site to confirm Error 500 is resolved.
Quick Fix
Error 500 requires diagnosis, not waiting. Check your PHP error logs immediately—they reveal the exact problem. If logs show memory issues, increase PHP memory limit; if plugins are suspect, deactivate all of them to isolate the culprit.
tail -50 /home/*/public_html/error_log | grep -i error
In This Article
- What Error 500 Means and Why It Appears
- Check PHP Error Logs First—Most Errors Hide Here
- Deactivate All Plugins—The Most Common Culprit
- Increase PHP Memory Limit If Logs Show Memory Exhaustion
- Check PHP Version Compatibility—Old Code Breaks on New PHP
- Verify the Fix and Confirm Error 500 Is Gone
- Prevent Error 500 From Recurring
What Error 500 Means and Why It Appears
HTTP 500 Internal Server Error is a catch-all status code. It means the server hit a failure while processing your request, but the response itself carries no detail about what broke — that’s by design. The browser can’t tell you if it was a PHP fatal error, a database timeout, or a permissions mismatch, because the server never got far enough to build a normal response.
You’ll see it most often right after a change, not out of nowhere. Common triggers:
- Activating a plugin that calls a function your PHP version doesn’t have
- A theme update that references a missing file or renamed hook
- Bumping PHP from 8.1 to 8.3 and breaking a dependency that assumed old syntax
- PHP hitting its
memory_limitmid-request and dying with a fatal error - A corrupted or misconfigured
.htaccessfile after a migration - An upstream service (database, PHP-FPM pool, Redis) refusing new connections
The generic error page you see in Chrome or Firefox is deliberately vague — most servers are configured not to leak stack traces to the public, for good reason. That’s a security setting, not a bug. The real cause is sitting in a log file on the server, usually within the last few lines of the most recent timestamp.
Here’s the part that should calm you down: Error 500 is one of the most deterministic errors to fix. Unlike a flaky network timeout, the server logged exactly what killed the request. Once you read that line, the fix is usually a single command. The rest of this article walks through the log locations and fixes in order of how often each one is the actual cause.
Check PHP Error Logs First—Most Errors Hide Here
Before you touch any config file or reinstall any plugin, read the log. This one step resolves roughly 70% of Error 500 cases because the log tells you exactly which line of code died and why — no guessing required.
Log locations vary by stack, so check the one that matches your setup:
- WordPress with debug enabled:
wp-content/debug.log - PHP-FPM (most managed hosts, Ubuntu 22.04/24.04, Debian 12):
/var/log/php-fpm.logor/var/log/php8.3-fpm.log - Apache:
/var/log/apache2/error.log - Nginx:
/var/log/nginx/error.log
Tail whichever one applies in real time while you reload the broken page:
tail -f /var/log/nginx/error.log
This streams new lines as they’re written — reload the site in another tab and watch for the error to appear within a second or two.
Look specifically for four patterns: Fatal error, Parse error, Allowed memory size exceeded, and Call to undefined function. If you’re running PHP 8.2, 8.3, or 8.4 (the current default on most 2026 hosting panels), old plugin code written for PHP 7.x often throws Call to undefined function or deprecated-argument fatals that never showed up before an upgrade.
Enable WordPress Debug Mode to Capture the Real Error
If you’re on WordPress and nothing’s showing in the server logs, WP_DEBUG will force PHP to write the actual error to a dedicated file instead of swallowing it.
SSH into the server and open the config file:
nano wp-config.php
This opens the file in a terminal editor — find the line that says /* That's all, stop editing! Happy publishing. */.
Add these three lines directly above it:
define('WP_DEBUG', true);
define('WP_DEBUG_LOG', true);
define('WP_DEBUG_DISPLAY', false);
Save with Ctrl+O, then Ctrl+X. WP_DEBUG_DISPLAY false keeps the error out of the visitor’s browser — it only writes to the log file, which is what you want on a live site.
Reload the broken page once, then check the log:
grep -i 'fatal\|parse\|error' wp-content/debug.log | tail -20
This prints the last 20 matching lines, and the most recent timestamp at the bottom is almost always your culprit.
Deactivate All Plugins—The Most Common Culprit
If you’ve got a plugin path in that debug log, or you just upgraded WordPress or PHP recently, plugins are the first suspect. They cause roughly 40% of Error 500s on WordPress sites, and the fix takes under a minute. This applies to WordPress 6.4 and newer, where plugin activation state is stored the same way regardless of PHP version.
If you can still SSH in and WP-CLI is installed, this is the fastest path:
wp plugin deactivate --all
This turns off every active plugin without deleting any files. Reload the site. If the 500 is gone, you’ve confirmed a plugin is the cause — not the theme, not core.
Locked out of both wp-admin and SSH access to WP-CLI? Go straight to the database:
mysql -u your_db_user -p your_db_name -e "UPDATE wp_options SET option_value = 'a:0:{}' WHERE option_name = 'active_plugins';"
This sets the active plugins list to an empty serialized array, which WordPress reads as “no plugins active.” Nothing is deleted — plugin files stay untouched in wp-content/plugins/, and you can reactivate any of them later.
Plugins updated in 2026 to claim PHP 8.4 support don’t always deliver on it cleanly — a lot of authors test against 8.2 and ship anyway. If your host defaults to 8.4, that’s worth remembering before you blame the plugin’s code for something that’s really a version mismatch.
Reactivate Plugins One at a Time to Isolate the Offender
Once the site loads clean with everything off, bring plugins back one by one:
wp plugin activate
Reload the site after each activation. The moment the 500 error comes back, you’ve found the offender — stop there.
From here you’ve got three options: check for a pending update, open the plugin’s GitHub issues page and search for “500” or “fatal” plus the current WordPress version to see if others hit the same wall in 2026, or just remove it and find a replacement. Don’t reactivate the rest until you’ve dealt with that one.
Increase PHP Memory Limit If Logs Show Memory Exhaustion
If your debug log has a line like Allowed memory size of 268435456 bytes exhausted (tried to allocate 20480 bytes), stop looking at plugins and theme code. This is a resource ceiling, not a bug — PHP is telling you the script ran out of room to work in.
The number in bytes is your current limit (268435456 bytes = 256M, for reference). Raise it with one of three methods depending on what access you have.
1. wp-config.php (works on every host)
define('WP_MEMORY_LIMIT', '256M');
Add this line before the line that says /* That's all, stop editing! Happy publishing. */ and before any debug constants. Save, reload the site.
2. .htaccess (Apache only)
php_value memory_limit 256M
Add this near the top of .htaccess, above the WordPress rewrite block. This does nothing on Nginx — check your web server first with ps aux | grep -E 'apache|nginx'.
3. php.ini (if you manage the server)
memory_limit = 256M
Find the file with php -i | grep "Loaded Configuration File", edit that line, then restart PHP-FPM: sudo systemctl restart php8.2-fpm.
256M is a safe starting point for PHP 8.2+ and covers most sites. If you run a media-heavy site — large galleries, WooCommerce product imports, big PDF exports — go straight to 512M instead of inching up.
On shared hosting, these directives sometimes get silently ignored because the host caps memory at the account level regardless of what you set. Check with php -r "echo ini_get('memory_limit');" after making the change — if it still reports the old value, open a support ticket and ask them to raise the limit directly, since no config file on your end will override it.
Check PHP Version Compatibility—Old Code Breaks on New PHP
If the fixes above didn’t clear the 500, check what PHP version is actually running. PHP 8.4 is standard on most hosts in 2026, and it removed or changed behavior for a lot of functions that older themes and plugins still call.
php -v
Confirms the active CLI version — but note this can differ from the version PHP-FPM uses for web requests, so also check phpinfo() or your host’s control panel.
Open your error log and look for either of these exact lines:
PHP Fatal error: Uncaught Error: Call to undefined function mysql_connect()
PHP Fatal error: Uncaught Error: Undefined constant "FILTER_SANITIZE_STRING"
Grep the function or constant name across your active theme and plugins:
grep -r "mysql_connect" wp-content/plugins/ wp-content/themes/
This tells you exactly which file is still calling the removed function.
The usual culprits: mysql_* functions (removed in PHP 7.0), split() (removed in PHP 7.0), and create_function() (removed in PHP 8.0). If a plugin was last updated before 2022, assume it’s using at least one of these.
Update Theme or Plugin to 2026-Compatible Version
wp plugin update contact-form-7
Replace the slug with your actual plugin name. Run wp theme update twentytwentyfour for themes. If WP-CLI reports “No update available,” and you know the plugin is old, it’s abandoned — don’t wait for a fix that isn’t coming.
Check the plugin’s claimed compatibility before you update or replace anything:
cat wp-content/plugins/your-plugin/readme.txt | grep "Tested up to"
If it says “Tested up to: 5.9,” that plugin was abandoned years before PHP 8.4 existed. Search the WordPress.org plugin directory for an actively maintained alternative — filter by “Last updated” and pick something touched in the last 90 days. Most legitimate 2025-2026 plugin releases explicitly list PHP 8.4 support in their changelog.
Remember: WordPress 6.5+ requires PHP 7.4 minimum, but 6.6+ recommends 8.0 or higher. Running a 2019-era plugin on a 2026 PHP version is the single most common cause of Error 500 on self-hosted WordPress sites right now.
Verify the Fix and Confirm Error 500 Is Gone
Don’t just eyeball the homepage and call it done. Reload the exact URL that was throwing the 500 — hard refresh with Ctrl+Shift+R so you’re not looking at a cached error page from your browser or a CDN edge node.
tail -5 wp-content/debug.log
This shows the last five log entries. If your fix worked, there should be no new PHP Fatal error lines timestamped after your change. If the same error is still appending, your fix didn’t take — check you edited the right file or cleared any opcode cache with wp cache flush.
If you’re running WP-CLI 2.9 or newer, run a broader sanity check:
wp health-check list
This flags PHP version mismatches, missing extensions, and broken cron — anything left unresolved shows up here instead of waiting to surface as another outage next week.
Open the browser console with F12 and check the Console and Network tabs. A page can return an HTTP 200 and still look broken because of an unrelated JS error — don’t confuse that with a returning 500. Confirm the actual status code in the Network tab, or check the server access log directly:
tail -20 /var/log/nginx/access.log | grep " 500 "
An empty result after your fix means no new 500s are landing. If you still see them stacking up, you fixed a symptom, not the cause — go back to the debug log and start over.
Prevent Error 500 From Recurring
Most 500 errors trace back to an outdated plugin colliding with a core update nobody tested first. Fix the pattern, not just the incident.
wp core update
wp plugin update --all
Run these weekly, not whenever something breaks. Expect a list of updated plugins with version numbers — read it, don’t skim past a failed update silently.
Never run these directly against production. Clone to a staging site first — most managed hosts (WP Engine, Kinsta, SiteGround) include one-click staging free with every plan. If staging survives the update, push to production. If it doesn’t, you just saved yourself a live outage.
Keep WP_DEBUG set to true in wp-config.php, but never WP_DEBUG_DISPLAY — log errors to file, don’t splash them on visitors’ screens:
define( 'WP_DEBUG', true );
define( 'WP_DEBUG_DISPLAY', false );
define( 'WP_DEBUG_LOG', true );
Set a cron job to email you when new fatals land, instead of finding out from an angry customer:
0 * * * * grep -q "PHP Fatal" /path/to/wp-content/debug.log && mail -s "Fatal error detected" you@yourdomain.com < /path/to/wp-content/debug.log
This runs hourly and only sends mail if a fatal actually appears.
Install Health Check & Troubleshooting (free, actively maintained for 2026) — its Troubleshooting Mode disables plugins one at a time on the front end without affecting other visitors, which catches conflicts before they go live.
Run PHP 8.3 or 8.4 — most hosts auto-update PHP now, but check your hosting panel to confirm you're not stuck on 8.1, which several 2026-era plugins have quietly dropped support for.
Frequently Asked Questions
Can Error 500 go away on its own?
No. Error 500 indicates a server-side problem that persists until fixed. Temporary server glitches may resolve briefly, but the underlying issue remains and will recur without intervention.
What causes Error 500 on WordPress?
Plugin conflicts, PHP memory limits, incompatible PHP versions, and corrupted .htaccess files are primary causes. Check PHP error logs to identify the exact culprit affecting your site.
How do I find Error 500 details in logs?
Access your hosting control panel, navigate to File Manager, locate the error_log file in your public_html directory, and download it. Search for recent entries matching your error timestamp to see specific failure details.
Will increasing PHP memory limit fix Error 500?
Only if your logs show memory exhaustion errors. Increasing the PHP memory limit in wp-config.php resolves memory-related crashes, but won't help if the problem stems from plugins or version conflicts.
Related Reads
- Is 500 Server Error My Fault? WordPress Troubleshooting
500 server error in WordPress? Find out if it's your fault and fix it in 5 minutes with copy-paste commands ordered by l…
- Fix GRUB Rescue Unknown Filesystem Error
GRUB rescue unknown filesystem error? Copy-paste fixes ordered by likelihood. Works on Ubuntu, Debian, Fedora. Senior en…