Troubleshooting

Fix a 500 Internal Server Error on cPanel hosting

Find and fix the cause of a 500 Internal Server Error on any cPanel site: broken .htaccess rules, wrong permissions, PHP version or memory problems and script errors.

IntermediatecPanel hosting2 min read

"500 Internal Server Error" means the server could not finish the request, but it does not say why. On cPanel hosting the cause is almost always one of five things: a broken .htaccess rule, wrong file permissions, a PHP fatal error, an incompatible PHP version, or running out of memory. The logs point you to the right one in minutes.

Before you start

  • Note when the error started and what changed just before (plugin update, new code, PHP version change, a redirect you added).
  • For WordPress-specific causes, also see fix a 500 error in WordPress.

Read the logs first

  1. Load the failing page once.
  2. Open cPanel → Metrics → Errors and read the newest lines.
  3. Open File Manager and look for a file named error_log in the site folder (and in wp-admin for WordPress). The last lines show PHP fatal errors.

Details on reading them: error and access logs in cPanel.

Match the log message to a fix

Log saysCauseFix
Invalid command '...', .htaccess: ... not allowed hereUnsupported directive in .htaccessRemove or comment out that line
is writable by group, SoftExceptionPermissions too open (e.g. 777)Files 644, folders 755
PHP Fatal error: ... in /home/user/public_html/...Code error, often a plugin or themeDisable or roll back the named component
Allowed memory size ... exhaustedPHP memory limit too lowRaise memory_limit
Call to undefined function, deprecated syntaxWrong PHP version or missing extensionChange version or enable extension
End of script output before headersProcess killed (resource limit or crash)Check resource usage and memory

Test the .htaccess file

  1. In File Manager, open Settings and tick Show Hidden Files (dotfiles).
  2. Rename public_html/.htaccess to .htaccess.bak.
  3. Reload the site. If it works (perhaps with broken pretty URLs), the problem is in that file.
  4. Restore the file and remove the most recently added rules, e.g. a php_value line (not supported with LSAPI/PHP-FPM; use the MultiPHP INI Editor instead) or an AddHandler line forcing an old PHP version.

Tip: For WordPress, saving Settings → Permalinks recreates a clean default .htaccess.

Fix permissions

cPanel servers refuse to run PHP files that are writable by group or others. Select the file in File Manager → Permissions and set 644 (folders 755). For a whole site, use the commands in cPanel Terminal. Never use 777.

PHP version and limits

Still stuck?

Restore yesterday's files from JetBackup to get the site online, or open a support ticket with the URL and the time of the error; we can read the server-side logs that you cannot see.

Next steps

Was this guide helpful?

Still stuck?

Ask MdmHost AI for a quick answer, or open a ticket and our team will take a look. We are here 24/7.