I have uploaded 2.2.2 file on my server and wanted to install it but it gives Internal Server Error. I have checked the cPanel error.log and found following error log

[Thu Dec 28 22:35:40.272102 2017] [core:alert] [pid 28738] [client] /public_html/.htaccess: Invalid command ' < IfVersion', perhaps misspelled or defined by a module not included in the server configuration

How can I do?

Thank you

  • Try to give permission 777 to pub/static, generated and app/etc folders using command sudo chmod -R 777 var pub/static generated app/etc Dec 28, 2017 at 14:47
  • used this command but can't
    – niceonelee
    Dec 28, 2017 at 14:52
  • i updated original post please check
    – niceonelee
    Dec 28, 2017 at 14:59
  • Are you using nginx ? Dec 28, 2017 at 15:03

5 Answers 5


Make sure you have mod_version installed (see https://httpd.apache.org/docs/2.4/mod/mod_version.html )

If you cannot install mod_version on your server, you can revert this PR in your local .htaccess Files


but I strongly recommand not doing this, as locally modifying files always makes is nearly impossible to update later! And depending on your setup it should be quite easy to install mod_version.

  • i just installed mod_version but still not work
    – niceonelee
    Dec 28, 2017 at 15:09
  • and my Server Version: Apache/2.4.29
    – niceonelee
    Dec 28, 2017 at 15:15
  • did you restart apache after installing mod_version? Dec 28, 2017 at 15:19
  • can you type in the command "apache2ctl -M" and paste the output here, to make sure, the module is correctly loaded. Dec 28, 2017 at 15:20
  • you can also type "a2enmod version" to check if version is enabled (restart apache after this) Dec 28, 2017 at 15: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.

  • it is worked for me. Thanks May 12, 2019 at 9:54

I am using wampserver 3.1.9.

1st of all the error is related to "Apache Server ". So please review the apache's error log

My Error log:

{{hostDir}}/magento_cms/.htaccess: Invalid command '<IfVersion', perhaps misspelled or defined by a module not included in the server configuration

For the above error I have enabled an apache module named "version_module", which resolved my issue.

  • This worked great for me. Thanks Ramesh.
    – nematoth
    Dec 12, 2019 at 3:32

Make backup of your .htaccess file.

  1. Find this lines and check them I think you have missing something there.



       <IfVersion < 2.4>
>             order allow,deny
>             deny from all
>           </IfVersion>
  1. Or delete htaccess and add one from Magento package

  2. Enable mod_version in your apache Somewhere depends from what distribution you use /etc/apache2/sysconfig.d/loadmodule.conf.

  • but my file is new download from Magento
    – niceonelee
    Dec 28, 2017 at 14:53
  • But something goes wrong, try rename this file
    – BartZalas
    Dec 28, 2017 at 14:56
  • if i delete htaccess is work. But when i upload again is Internal Server Error
    – niceonelee
    Dec 28, 2017 at 14:56
  • i updated original post please check
    – niceonelee
    Dec 28, 2017 at 14:59
  • Try to download one from Magento git, maybe it's something wrong with yours. Can you send me this file?
    – BartZalas
    Dec 28, 2017 at 15:00

Enable mod_version apache module by un commenting the following line in your apache httpd.conf file

LoadModule version_module modules/mod_version.so

and you will be good to go

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.