If your website shows a "500 Internal Server Error" after you change the PHP version, the cause is usually the .htaccess file.
- Open the .htaccess file in your public_html folder.
- 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
- Check that the PHP version is the same in both lines, for example "ea-php84" in each.
- Check that each line sits on its own line. Sometimes lines get joined together, which causes the error.