How to Fix 500 Internal Server Error in Magento 2

When you update, install, backup, restore, move to another server, or remove a component such as a theme, patches, plugins…on your Magento 2 website, you might encounter the error “Magento 500 Internal Server Errors”.

The error looks like as here

Follow case below to fix this.

1. Change Magento file permission.

You need sure permission files correctly the index.php should have permission 644. If you use Cpanel can change as image below or you can login ssh after going to root Magento and run the command: chmod 644 index.php .

 

2. Try edit or rename .hatccess

Sometime error cause config default in file .htaccess of Magento incompatible with version apache, httpd in your server.

Remove all block with the format as image below in file .htaccess and .htaccess pub/.htaccess:

If still not fix you can try rename file .htaccess to .htaccess_backup after check again.

3. Enable Developer mode

Run comman php bin/magento deploy:mode:set developer or add direct code ini_set('display_startup_errors', 1);ini_set('display_errors', 1); error_reporting(-1); to file index.php