magento2: Invalid command '
Preconditions
- My current Magento version is Magento Open Source 2.2.1
- I need to upgrade to Magento Open Source 2.2.2 via command line
Steps to reproduce
- I have run all the necessary commands to upgrade my version to Magento Open Source 2.2.2
- No errors found during the upgrade, and it finished smoothly
Expected result
- After update, the website should function normally with the latest version
Actual result
- After update, I am getting a 500 Internal Server Error error for both admin and front-end
- 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
Preconditions
- My current Magento version is Magento Open Source 2.2.1
- I need to upgrade to Magento Open Source 2.2.2 via command line
Steps to reproduce
- I have run all the necessary commands to upgrade my version to Magento Open Source 2.2.2
- No errors found during the upgrade, and it finished smoothly
Expected result
- After update, the website should function normally with the latest version
Actual result
- After update, I am getting a 500 Internal Server Error error for both admin and front-end
- 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
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Comments: 24
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:\wamp\bin\apache\apache2.4.33\conf\httpd.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.
@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_versionand upgraded to 2.2.2. Everything works now. Thank you@magento-engcom-team, you may close this issue.
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_versionand install itI 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
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
@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.