UnderHost
Knowledgebase Docs

Fixing a 500 Internal Server Error

A 500 error means the server encountered an unexpected problem. This UnderHost guide shows how to find the cause in logs and fix common PHP, .

On this page

A 500 error is a catch-all that means "something went wrong on the server." The public error page usually hides the cause, so the fastest fix is to check the error log for the exact file, line, or service message. On UnderHost shared hosting, start in cPanel. On VPS or dedicated servers, check your control panel logs and the web server/PHP logs over SSH.

Find the specific error

In cPanel, go to Metrics → Errors. In aaPanel or CloudPanel, open the website error log for the affected domain. The log shows timestamped entries with the exact file and line number causing the issue. Look for entries corresponding to when the 500 error occurred.

Common patterns in error logs and what they mean:

Log messageLikely cause
syntax error in .htaccessMalformed .htaccess rule
PHP Fatal error: Allowed memory size exhaustedPHP memory limit too low
Permission deniedWrong file permissions
PHP Fatal error: Call to undefined functionPHP version mismatch or missing extension
Maximum execution time exceededScript running too long-increase max_execution_time

.htaccess problems

A malformed line in .htaccess causes an immediate 500 error because Apache can't parse the file. Test by renaming .htaccess to .htaccess_bak in File Manager and reloading. If the 500 disappears, the .htaccess file is the problem. Review each line carefully for typos.

PHP fatal errors

PHP errors that crash execution before any output cause a 500. Enable error display temporarily:

.htaccess (temporary)
php_flag display_errors On
php_value error_reporting 32767

Reload the page-the error should appear instead of the 500 screen. Remove these lines after fixing the issue.

Permission errors

If the log shows "Permission denied", a script is trying to access a file it doesn't have permission to read or execute. Check that your files are 644 and directories are 755. Script files that need to execute should be 755.

Server-side errors

If none of the above applies and the error persists, the issue may be on the server side (service crash, resource exhaustion). Check the UnderHost Network Status page first. If no incident is listed, open a technical support ticket with your domain name, the time the error started, and any log excerpts you found.

For VPS or dedicated servers, include recent changes such as PHP version changes, plugin updates, firewall changes, package upgrades, or resource spikes. UnderHost support can investigate infrastructure and managed-service issues, but application code errors are much faster to resolve when you include the exact log entry.

Related: WordPress 500 error | Fixing a 403 Forbidden error | My website is down-what to check first | PHP settings in cPanel

Was this article helpful?

Still troubleshooting?

Use UnderHost tools for quick checks, or open a support ticket when the issue needs account or server access.

Related articles

Back to Troubleshooting