6

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

  • 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 – Chander Shekhar Dec 28 '17 at 14:47
  • used this command but can't – niceonelee Dec 28 '17 at 14:52
  • i updated original post please check – niceonelee Dec 28 '17 at 14:59
  • Are you using nginx ? – zed Blackbeard Dec 28 '17 at 15:03
7

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.

  • i just installed mod_version but still not work – niceonelee Dec 28 '17 at 15:09
  • and my Server Version: Apache/2.4.29 – niceonelee Dec 28 '17 at 15:15
  • did you restart apache after installing mod_version? – Jonas Hünig Dec 28 '17 at 15:19
  • can you type in the command "apache2ctl -M" and paste the output here, to make sure, the module is correctly loaded. – Jonas Hünig Dec 28 '17 at 15:20
  • you can also type "a2enmod version" to check if version is enabled (restart apache after this) – Jonas Hünig Dec 28 '17 at 15:24
4

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.

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.

  • but my file is new download from Magento – niceonelee Dec 28 '17 at 14:53
  • But something goes wrong, try rename this file – BartZalas Dec 28 '17 at 14:56
  • if i delete htaccess is work. But when i upload again is Internal Server Error – niceonelee Dec 28 '17 at 14:56
  • i updated original post please check – niceonelee Dec 28 '17 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 '17 at 15:00
0

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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