Fix "500 Internal Server Error" on Your Website
500 Internal Server ErrorHTTP ERROR 500A 500 error is the server's way of saying "something broke and I can't be more specific." The real message is in the error log — here's how to find it and fix the common causes.
In DirectAdmin/cPanel open the Error Log, or check ~/domains/yourdomain/logs/ on the server. The 500 page hides the detail; the log shows the exact line and file that failed.
Cause 1: a broken .htaccess
An invalid directive in .htaccess (often from a plugin) throws an instant 500. Rename it to test:
mv .htaccess .htaccess.bak
# reload the site — if it works, the .htaccess was the problem
If that fixes it, regenerate a clean .htaccess (in WordPress: Settings → Permalinks → Save).
Cause 2: wrong file permissions
Web files should generally be 644 and folders 755. A script set to 777 can actually be refused by the server under suEXEC. Reset them:
find . -type f -exec chmod 644 {} \;
find . -type d -exec chmod 755 {} \;
Cause 3: a PHP error or wrong PHP version
A fatal PHP error returns a 500. The error log names the file and line. Common fixes: switch the PHP version (in DirectAdmin → PHP Selector) to one your app supports, or fix the offending code/plugin.
Cause 4: exhausted PHP memory
"Allowed memory size exhausted" in the log means PHP ran out of memory. Raise the limit in php.ini or a custom config:
memory_limit = 256M
The clean checklist
- Open the error log — it names the real cause.
- Rename
.htaccessto test it. - Reset permissions to 644 files / 755 folders.
- Check the PHP version and error log for fatals.
- Raise
memory_limitif the log says it's exhausted.
A 500 is never random. The error log always names the file and line — read it before changing anything.
Cause 5: a 500 Internal Server Error from a broken database connection
Some apps throw a raw 500 Internal Server Error instead of a friendlier database-error screen when the database is unreachable and the failure isn't handled gracefully. Check the database credentials in your app's config (for WordPress, wp-config.php) and confirm the database service is actually running before assuming it's a code problem.
Cause 6: a bad server-level config change
If the 500 Internal Server Error started right after a config change — php.ini, an nginx/Apache .conf, or a PHP-FPM pool — the config itself may be invalid. Test the config syntax before reloading the service, and check the web server's own error log, not just the site's, since a config-level failure often doesn't reach the application log at all.
How to prevent 500 Internal Server Errors
- Test
.htaccessand config changes on a staging copy before production. - Keep plugins/themes and your PHP version compatible — update them together, not separately.
- Set a sane
memory_limit(256M+) proactively rather than raising it only after a crash. - Watch the error log after every deploy, not just when a user reports a blank page.
- Keep a recent backup so you can roll back a bad update fast instead of debugging live.
Related web hosting errors
If WordPress shows a blank page instead of a 500 page, see WordPress white screen of death. If the error explicitly mentions the database, read "Error establishing a database connection". Behind a reverse proxy, a similar failure shows as nginx 502 Bad Gateway, and a permissions-only issue may instead show as 403 Forbidden.
Fast, protected web hosting
Our web hosting runs on NVMe with a clean DirectAdmin panel, PHP selector and DDoS protection included.
Frequently asked questions
What causes a 500 Internal Server Error?
A server-side failure the web server can't explain to the browser — most often a broken .htaccess, wrong file permissions, a fatal PHP error, or exhausted PHP memory. The error log identifies which.
Where is the error log in DirectAdmin?
In the DirectAdmin panel under "Error Log" for the domain, or on disk under ~/domains/yourdomain.com/logs/. It records the exact reason behind each 500.
Why did 777 permissions cause a 500?
On servers using suEXEC/suPHP, files or folders that are group- or world-writable (like 777) are rejected for security, returning a 500. Use 644 for files and 755 for folders instead.
Why do I get a 500 error only on some pages, not the whole site?
That points to a page-specific script, plugin or template causing the fatal error, rather than a global config problem. Check the error log for the exact file and line tied to that page's request.
Can a plugin cause a 500 Internal Server Error?
Yes — a plugin with a fatal PHP error, an incompatible PHP version requirement, or its own broken .htaccess rules is one of the most common causes on WordPress and similar CMS platforms.
Is a 500 error the same as a WordPress white screen of death?
They're closely related — both are usually caused by a fatal PHP error. The difference is just what the browser shows: WordPress sometimes suppresses the 500 status and renders a blank page instead.
Does clearing cache fix a 500 error?
Rarely on its own, since a 500 is a server-side failure, not a stale-content problem. But clear cache after you've actually fixed the underlying cause, so you're not looking at an old cached error page.
Go deeper on this
Guides and explainers that pair with this fix — from our guides and blog.
How to Speed Up a WordPress Site
Caching, images, PHP version and the hosting underneath.
ReadHow to Secure a WordPress Site
Updates, passwords, plugins and backups that actually matter.
ReadHow to Choose a Web Host
What to look for beyond the headline price.
ReadcPanel vs DirectAdmin vs Plesk
Which control panel does what, and what it costs.
ReadRelated articles
How to Point a Domain to Your Server (DNS A Record)
How to point a domain at your server with an A record — and why it doesn't work instantly.
Read fix Web HostingFix Email Going to Spam (SPF, DKIM & DMARC Explained)
Mail landing in spam? Set SPF, DKIM and DMARC correctly so your email reaches the inbox.
Read fix Web HostingFix "502 Bad Gateway" on Your Website
A 502 Bad Gateway? It's the backend (usually PHP-FPM) failing — every cause and how to fix it.
Read fix