Magento2: Invalid command '<IfVersion', perhaps misspelled or defined by a module not included in the server configuration

Created on 16 Dec 2017  路  22Comments  路  Source: magento/magento2


Preconditions


  1. My current Magento version is Magento Open Source 2.2.1
  2. I need to upgrade to Magento Open Source 2.2.2 via command line

Steps to reproduce

  1. I have run all the necessary commands to upgrade my version to Magento Open Source 2.2.2
  2. No errors found during the upgrade, and it finished smoothly

Expected result

  1. After update, the website should function normally with the latest version

Actual result

  1. After update, I am getting a 500 Internal Server Error error for both admin and front-end
  2. I checked the server error log, and it says Invalid command '<IfVersion', perhaps misspelled or defined by a module not included in the server configuration

My site was working smoothly before the upgrade, so I don't think there was any misconfiguration happened on my server, except cPanel update. If this is not a technical issue from Magento's end, can someone help me to fix it, as I haven't found any helping articles fixing this particular issue

Format is valid

Most helpful comment

i had the same problem and it was annoying because there wasn't alot of clear answers or it seemed everyone was using Linux or something else. But i am using Windows 10 latest version as of April 9th, 2018 with Wamp Server (latest version with PHP 7.1 installed). I went to the C:wampbinapacheapache2.4.33confhttpd.conf file and uncommented (removing the # sign) from the LoadModule version_module modules/mod_version.so line. Hope this works for you and anyone else that stumbles across this.

All 22 comments

@pmjcreations - this same issue happened on my server - with a clean install.
to resolve this issue I installed an Apache module "mod_version" and was able to log into the admin and view front end normally.
possibly this module is not being flagged as a requirement when performing installs and upgrades.

Well, @hudsondonovan, I have enabled mod_version and upgraded to 2.2.2. Everything works now.
Thank you

@magento-engcom-team, you may close this issue.

@pmjcreations could you please let me know how to enable mod_version in cPanel ? I am facing the same issue with clean Magento 2.2.2 install
Thanks.

Hi @Vikram0811

Go to WHM > Software > EasyApache 4 and click on the Customize button in Currently Installed Packages section.
In Apache Modules section, you can search for mod_version and install it

Hi,

It seems I do not have access to WHM panel, though I can login to cPanel. Is there any other way I can enable mod_version ?
Thanks

If you don't have access to WHM, you may not have shell access.

Try to contact your hosting provider or your system admin. Else find another hosting set-up like a VPS which will give you full root access.

I can confirm I had this issue after fresh 2.2.2 install and the suggestions from @pmjcreations has fixed my issue. Thank you.
馃
Go to WHM > Software > EasyApache 4 and click on the Customize button in Currently Installed Packages section.
In Apache Modules section, you can search for mod_version and install it

i had the same problem and it was annoying because there wasn't alot of clear answers or it seemed everyone was using Linux or something else. But i am using Windows 10 latest version as of April 9th, 2018 with Wamp Server (latest version with PHP 7.1 installed). I went to the C:wampbinapacheapache2.4.33confhttpd.conf file and uncommented (removing the # sign) from the LoadModule version_module modules/mod_version.so line. Hope this works for you and anyone else that stumbles across this.

Had the same issue. Many thanks @bastianhilton

@bastianhilton Thanks buddy. Faced the same issue in Windows 10 latest version and PHP 7.0 WAMP. Solved.

@bastianhilton thanks man.

Thanks @bastianhilton

thxxxxx. Spend a day on this.

Obrigado @pmjcreations , estava sofreno com esse problema, agora tudo resolvido

what about the same issue on cpanel...
I have done on localhost and it worked but cpanel has issues..

@Nellyazx,

Go to WHM > Software > EasyApache 4 and click on the Customize button in the Currently Installed Packages section.
In Apache Modules section, you can search for mod_version and install it.

If you don't have access to WHM, you may not have shell access.

Try to contact your hosting provider or your system admin. Else find another hosting set-up like a VPS which will give you full root access.

Well, @hudsondonovan, I have enabled mod_version and upgraded to 2.2.2. Everything works now.
Thank you

@magento-engcom-team, you may close this issue.

In apache version 2.4.9, mod_version module is named as "version_module" in WAMP. I enabled it and magento worked as charm. Thank you for the post

Same here, should really consider flagging it as a requirement when performing installs and upgrades. If not for this git page not sure how else we would figure out that we need to enable the mod_version apache module

No apache do Wamp o modulo 茅 version_module

Well, @hudsondonovan, I have enabled mod_version and upgraded to 2.2.2. Everything works now.
Thank you
@magento-engcom-team, you may close this issue.

In apache version 2.4.9, mod_version module is named as "version_module" in WAMP. I enabled it and magento worked as charm. Thank you for the post

This answer should fix the issue for windows users. Good Answer

@bastianhilton worked completely fine. Thanks a lot!! You saved me a lot of time finding for solution.

i had the same problem and it was annoying because there wasn't alot of clear answers or it seemed everyone was using Linux or something else. But i am using Windows 10 latest version as of April 9th, 2018 with Wamp Server (latest version with PHP 7.1 installed). I went to the C:wampbinapacheapache2.4.33confhttpd.conf file and uncommented (removing the # sign) from the LoadModule version_module modules/mod_version.so line. Hope this works for you and anyone else that stumbles across this.

tks bro, worked !

Was this page helpful?
0 / 5 - 0 ratings