Diagnose a 500 Internal Server Error

Use the error log to find the exact cause of a 500 error and work through .htaccess, PHP, permissions and version issues methodically.

TutorialIntermediate20 min to completeLast updated
On this page
  1. What you’ll need
  2. Step 1: Note the time and URL
  3. Step 2: Open the error log
  4. Step 3: Classify the entry
  5. Step 4: Test .htaccess
  6. Step 5: Fix the PHP error
  7. Step 6: Fix permissions
  8. Step 7: Check the PHP version
  9. Step 8: Retest and clean up
  10. Check it worked
  11. If something goes wrong
Level
Intermediate
Time
About 20 min
Steps
8
You’ll finish with
A working result, checked

8 steps

What you’ll need

  • DirectAdmin access
  • The URL showing the error

A 500 error hides its cause from visitors, but not from the log. You’ll read the log first, then test each likely cause in turn. 500 Internal Server Error: how to fix it

Step 1: Note the time and URL

Load the failing URL and note the exact time.

Step 2: Open the error log

Open System Info & Files › Site Summary / Statistics / Logs, choose the domain’s error log, and find entries matching that time. Viewing website statistics and logs in DirectAdmin

Step 3: Classify the entry

.htaccess messages → step 4. PHP Fatal/Parse → step 5. Permission denied → step 6. Nothing relevant → step 4 anyway.

Step 4: Test .htaccess

Show hidden files, rename .htaccess to .htaccess-off, reload. Fixed? Restore the file and remove recent rules until it works. What is .htaccess? A practical guide

Step 5: Fix the PHP error

Open the file and line named. Undo recent edits, or disable the plugin/theme folder named in the path. Understanding PHP error messages

Step 6: Fix permissions

Set folders to 755 and files to 644 for the path named. File permissions explained (644, 755 and why never 777)

Step 7: Check the PHP version

If the problem began after a version change, revert it. How to change the PHP version in DirectAdmin

Step 8: Retest and clean up

Reload in a private window, and restore any renamed files you no longer need renamed.

Check it worked

The URL returns the page normally and no new errors appear in the log when you reload it.

If something goes wrong

What happensWhat to do
Log is emptyLook for error_log files in public_html folders. How to find PHP errors (error logs and display_errors)
Whole account seems downIs it my website or the server? How to tell

Where this fits: DirectAdmin hosting explains the control panel every Traxio account uses, with a tour and tutorials.

Spotted something out of date or unclear? Tell us and we’ll fix it.

Keep going