“500 Internal Server Error” message after changing the PHP version Print

  • 0

If your website shows a "500 Internal Server Error" after you change the PHP version, the cause is usually the .htaccess file.

  1. Open the .htaccess file in your public_html folder.
  2. Scroll to the end. You will see a block like this:

# php -- BEGIN cPanel-generated handler, do not edit
# Set the "ea-php84" package as the default "PHP" programming language.
<IfModule mime_module>
AddType application/x-httpd-ea-php84 .php .php5 .phtml
</IfModule>
# php -- END cPanel-generated handler, do not edit

If your site uses the default PHP version, you will see this instead:

# php -- BEGIN cPanel-generated handler, do not edit
# This domain inherits the "PHP" package.
# php -- END cPanel-generated handler, do not edit

  1. Check that the PHP version is the same in both lines, for example "ea-php84" in each.
  2. Check that each line sits on its own line. Sometimes lines get joined together, which causes the error.

Was this answer helpful?

« Back