7

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 103.38.161.68:41924] /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

niceonelee
  • 725
  • 2
  • 10
  • 35

5 Answers5

8

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

https://github.com/magento/magento2/pull/11459/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.

Jonas Hünig
  • 491
  • 3
  • 7
5

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.

Sebastian
  • 160
  • 1
  • 4
2

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.

1

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.

BartZalas
  • 1,757
  • 12
  • 23
0

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

Farhan
  • 101
  • 2