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.
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.
Related 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 — how to find and fix it.
Read fix