Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

SOLVED Invalid command magento error

Discussion in 'General Discussion' started by KrasniyRus, Dec 23, 2017.

  1. KrasniyRus

    KrasniyRus Member

    Joined:
    Dec 23, 2016
    Messages:
    20
    Likes Received:
    1
    Trophy Points:
    3
    Location:
    Russia
    cPanel Access Level:
    Root Administrator
    Hello,

    I have installed Magento 2.2.2 version via Softaculous and instantly when the website is accessed "Internal Server Error" message occur. I have checked the Apache error log and noticed the following message:
    Code:
    [Sat Dec 23 22:28:41.395892 2017] [core:alert] [pid 423060:tid 140020161705728] [client xxx.xxx.xxx.xxx:51271] /home/user/example.com/.htaccess: Invalid command '<IfVersion', perhaps misspelled or defined by a module not included in the server configuration, referer: [URL]http://example.com.com/[/URL]
    
    I have researched over the net for a solution and it occur that such issue could be caused due to missing mod_version in Apache. I have tried to install the same with the following command:

    /usr/bin/apxs -c -i mod_version.c

    The console output of the command above is:
    Code:
    /opt/cpanel/ea-apr15/lib64/apr-1/build/libtool --silent --mode=compile gcc -std=gnu99 -prefer-pic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic  -DLINUX -D_REENTRANT -D_GNU_SOURCE -pthread -I/usr/include/apache2  -I/opt/cpanel/ea-apr15/include/apr-1   -I/opt/cpanel/ea-apr15/include/apr-1   -c -o mod_version.lo mod_version.c && touch mod_version.slo
    /opt/cpanel/ea-apr15/lib64/apr-1/build/libtool --silent --mode=link gcc -std=gnu99 -Wl,-z,relro,-z,now   -o mod_version.la  -rpath /usr/lib64/apache2/modules -module -avoid-version    mod_version.lo
    /usr/lib64/apache2/build/instdso.sh SH_LIBTOOL='/opt/cpanel/ea-apr15/lib64/apr-1/build/libtool' mod_version.la /usr/lib64/apache2/modules
    /opt/cpanel/ea-apr15/lib64/apr-1/build/libtool --mode=install install mod_version.la /usr/lib64/apache2/modules/
    libtool: install: install .libs/mod_version.so /usr/lib64/apache2/modules/mod_version.so
    libtool: install: install .libs/mod_version.lai /usr/lib64/apache2/modules/mod_version.la
    libtool: install: install .libs/mod_version.a /usr/lib64/apache2/modules/mod_version.a
    libtool: install: chmod 644 /usr/lib64/apache2/modules/mod_version.a
    libtool: install: ranlib /usr/lib64/apache2/modules/mod_version.a
    libtool: finish: PATH="/usr/local/cpanel/3rdparty/lib/path-bin:/usr/local/cpanel/3rdparty/lib/path-bin:/usr/local/cpanel/3rdparty/lib/path-bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/opt/cpanel/composer/bin:/root/bin:/sbin" ldconfig -n /usr/lib64/apache2/modules
    ----------------------------------------------------------------------
    Libraries have been installed in:
       /usr/lib64/apache2/modules
    
    If you ever happen to want to link against installed libraries
    in a given directory, LIBDIR, you must either use libtool, and
    specify the full pathname of the library, or use the `-LLIBDIR'
    flag during linking and do at least one of the following:
       - add LIBDIR to the `LD_LIBRARY_PATH' environment variable
         during execution
       - add LIBDIR to the `LD_RUN_PATH' environment variable
         during linking
       - use the `-Wl,-rpath -Wl,LIBDIR' linker flag
       - have your system administrator add LIBDIR to `/etc/ld.so.conf'
    
    See any operating system documentation about shared libraries for
    more information, such as the ld(1) and ld.so(8) manual pages.
    ----------------------------------------------------------------------
    chmod 755 /usr/lib64/apache2/modules/mod_version.so
    
    I have checked the mod_version.so in the provided directory and the same is available with correct permissions.

    I am using cPanel v68.0.21 with CloudLinux on CentOS 6.9 KVM. Any suggestion and insights are welcome, thank you in advance!
     
    #1 KrasniyRus, Dec 23, 2017
    Last edited by a moderator: Dec 23, 2017
  2. KrasniyRus

    KrasniyRus Member

    Joined:
    Dec 23, 2016
    Messages:
    20
    Likes Received:
    1
    Trophy Points:
    3
    Location:
    Russia
    cPanel Access Level:
    Root Administrator
    It occur that the missing Apache module_version is missing, I have installed the same via next command:

    yum install ea-apache24-mod_version

    And the issue is resolved.
     
  3. cPanelMichael

    cPanelMichael Technical Support Community Manager
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    44,803
    Likes Received:
    1,897
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    Hello,

    Yes, that's the correct command to install that module. The previous command you used is not supported with EasyApache 4.

    Thanks!
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice