Magento 2.2 – Fixing 500 Internal Server Error

Apache2installationmagento2.2permissions

I installed Magento2.2. After installing when I visit the site, it shows

500 Internal Server Error

The same for admin section as well.

I removed my .htaccess from root folder and tried. This time around front end loads without css and js, but admin section shows

404 Not Found

Can someone help?

I referred below but no luck.

Css and admin panel not working in Magento 2 Community Edition

My Apache error log says

[Sun Jan 21 16:40:19.568718 2018] [core:alert] [pid 12172:tid 1100] [client ::1:56158] D:/wamp/www/anto/certification/magento2/.htaccess: Invalid command IfVersion, perhaps misspelled or defined by a module not included in the server configuration,

Best Answer

For 500 error, you need to enable mod_version in apache.

You can check all the enabled apache modules with the command apache2ctl -M. If you don't see it in the list, then it's not installed.

To do this run the command a2enmod version as the root user, or sudo a2enmod version as a non-root user and then reload apache with apache2ctl reload.

For 404 error regarding css and js, you can try changing:

Options +FollowSymLinks

to

Options +SymLinksIfOwnerMatch

in the .htaccess file located in the following locations:

  • your Magento root install directoy (this is usually the /www/ or /public_html/ folder)
  • /pub/
  • /pub/static/
  • /pub/media/