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 mcrypt php extension

Discussion in 'EasyApache' started by Nirjonadda, Dec 6, 2017.

  1. Nirjonadda

    Nirjonadda Well-Known Member

    Joined:
    May 8, 2013
    Messages:
    599
    Likes Received:
    15
    Trophy Points:
    68
    cPanel Access Level:
    Root Administrator
    mcrypt php extension are not supported to install in PHP 7.2, So now how to enable this Mcrypt PHP extension?

    NMkQD39fTiC3jNPGMFeZlQ.png
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
    #1 Nirjonadda, Dec 6, 2017
    Last edited: Dec 6, 2017
  2. cPanelKenneth

    cPanelKenneth cPanel Development
    Staff Member

    Joined:
    Apr 7, 2006
    Messages:
    4,563
    Likes Received:
    42
    Trophy Points:
    308
    cPanel Access Level:
    Root Administrator
    Hi,

    The PHP developers deprecated mcrypt in version 7.1, and removed support in version 7.2. Applications should use either sodium or openssl for encryption needs.

    It may be possible to install mcrypt via PECL.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. Miguel G

    Miguel G Well-Known Member

    Joined:
    Jun 4, 2015
    Messages:
    84
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Spain
    cPanel Access Level:
    Root Administrator
    Twitter:
    How does this affect software as Wordpress? How do we enable mcrypt for php 7.2 using PECL without breaking EasyApache 4?
     
  4. cPanelMichael

    cPanelMichael Technical Support Community Manager
    Staff Member

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

    WordPress does not require mcrypt, so you shouldn't face any issues with WordPress unless specific third-party WordPress plugins make use of it. If you do decide to install the mcrypt PECL module for PHP 7.2, you'd need to do so using the following commands:

    Code:
    yum install libmcrypt
    yum install libmcrypt-devel
    /opt/cpanel/ea-php72/root/usr/bin/pecl install channel://pecl.php.net/mcrypt-1.0.1
    Thank you.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  5. Zoltan Szabo

    Zoltan Szabo Active Member

    Joined:
    Jul 13, 2017
    Messages:
    30
    Likes Received:
    5
    Trophy Points:
    8
    Location:
    Hungary
    cPanel Access Level:
    Root Administrator
    Dear All,

    I tried to setup mcyrpt php extension to php 7.2 on cpanel module installers page.
    I got the following error message:
    "Failed to download pecl/mcrypt within preferred state "stable", latest release is version 1.0.1, stability "snapshot", use "channel://pecl.php.net/mcrypt-1.0.1" to install
    install failed"

    I also tried the code written by cPanelMichael, but that also failed.
    Indeed the last command did manage to run but reported these errors:

    Code:
    root@server [~]# /opt/cpanel/ea-php72/root/usr/bin/pecl install channel://pecl.php.net/mcrypt-1.0.1
    downloading mcrypt-1.0.1.tgz ...
    Starting to download mcrypt-1.0.1.tgz (33,782 bytes)
    .........done: 33,782 bytes
    6 source files, building
    running: phpize
    Configuring for:
    PHP Api Version:         20170718
    Zend Module Api No:      20170718
    Zend Extension Api No:   320170718
    libmcrypt prefix? [autodetect] :
    building in /root/tmp/pear/pear-build-rootjInJtH/mcrypt-1.0.1
    running: /root/tmp/pear/mcrypt/configure --with-php-config=/opt/cpanel/ea-php72/root/usr/bin/php-config --with-mcrypt
    checking for grep that handles long lines and -e... /usr/bin/grep
    checking for egrep... /usr/bin/grep -E
    checking for a sed that does not truncate output... /usr/bin/sed
    checking for cc... cc
    checking whether the C compiler works... yes
    checking for C compiler default output file name... a.out
    checking for suffix of executables...
    checking whether we are cross compiling... no
    checking for suffix of object files... o
    checking whether we are using the GNU C compiler... yes
    checking whether cc accepts -g... yes
    checking for cc option to accept ISO C89... none needed
    checking how to run the C preprocessor... cc -E
    checking for icc... no
    checking for suncc... no
    checking whether cc understands -c and -o together... yes
    checking for system library directory... lib
    checking if compiler supports -R... no
    checking if compiler supports -Wl,-rpath,... yes
    checking build system type... x86_64-unknown-linux-gnu
    checking host system type... x86_64-unknown-linux-gnu
    checking target system type... x86_64-unknown-linux-gnu
    checking for PHP prefix... /opt/cpanel/ea-php72/root/usr
    checking for PHP includes... -I/opt/cpanel/ea-php72/root/usr/include/php -I/opt/cpanel/ea-php72/root/usr/include/php/main -I/opt/cpanel/ea-php72/root/usr/include/php/TSRM -I/opt/cpanel/ea-php72/root/usr/include/php/Zend -I/opt/cpanel/ea-php72/root/usr/include/php/ext -I/opt/cpanel/ea-php72/root/usr/include/php/ext/date/lib
    checking for PHP extension directory... /opt/cpanel/ea-php72/root/usr/lib64/php/modules
    checking for PHP installed headers prefix... /opt/cpanel/ea-php72/root/usr/include/php
    checking if debug is enabled... no
    checking if zts is enabled... no
    checking for re2c... no
    configure: WARNING: You will need re2c 0.13.4 or later if you want to regenerate PHP parsers.
    checking for gawk... gawk
    checking for mcrypt support... yes, shared
    configure: error: mcrypt.h not found. Please reinstall libmcrypt.
    ERROR: `/root/tmp/pear/mcrypt/configure --with-php-config=/opt/cpanel/ea-php72/root/usr/bin/php-config --with-mcrypt' failed
    
    Can you help me how to solve this issue? I rewrote all my crypting to openssl but 3rd party apps still use mcryt.
    Thank you
     
  6. cPanelMichael

    cPanelMichael Technical Support Community Manager
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    44,749
    Likes Received:
    1,885
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    Installing that PECL module using cPanel or WHM isn't supported because it's not released as a STABLE PECL module. The maintainers have only released the "snapshot" build of the module at:

    PECL :: Package :: mcrypt

    It looks like the "yum install libmcrypt-devel" command referenced in my last response incorrectly included a space after the hyphen. I've corrected it so that it correctly shows:

    Code:
    yum install libmcrypt-devel
    Can you run this command and then try running the PECL install command again to see if that solves the issue?

    Thank you.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  7. Zoltan Szabo

    Zoltan Szabo Active Member

    Joined:
    Jul 13, 2017
    Messages:
    30
    Likes Received:
    5
    Trophy Points:
    8
    Location:
    Hungary
    cPanel Access Level:
    Root Administrator
    Did land on an error:
    Code:
    root@server [~]# yum install libmcrypt-devel
    Loaded plugins: fastestmirror, universal-hooks
    Loading mirror speeds from cached hostfile
     * EA4: 85.13.201.2
     * cpanel-addons-production-feed: 85.13.201.2
     * base: mirror.sov.uk.goscomb.net
     * centosplus: mirror.sov.uk.goscomb.net
     * extras: mirror.sov.uk.goscomb.net
     * updates: mirror.sov.uk.goscomb.net
    No package libmcrypt-devel available.
    Error: Nothing to do
    
     
  8. cPanelMichael

    cPanelMichael Technical Support Community Manager
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    44,749
    Likes Received:
    1,885
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    Hello @Zoltan Szabo,

    It looks like your system is missing the EPEL YUM repo, which is required if you want to install that package. Here's a third-party URL with instructions on how to enable it:

    EPEL - Fedora Project Wiki

    Thank you.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  9. Zoltan Szabo

    Zoltan Szabo Active Member

    Joined:
    Jul 13, 2017
    Messages:
    30
    Likes Received:
    5
    Trophy Points:
    8
    Location:
    Hungary
    cPanel Access Level:
    Root Administrator
    Dear All,
    The suggested solution worked right then. Now let me just SUM up what you need to install mcrypt extension to php 7.2 on Cpanel.
    RPM link is for (Centos 7)! For other systems please see link in previous comments.

    Code:
    yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
    yum install libmcrypt
    yum install libmcrypt-devel
    /opt/cpanel/ea-php72/root/usr/bin/pecl install channel://pecl.php.net/mcrypt-1.0.1
    
    I hope this helps others with same problem
     
    cPanelMichael likes this.
  10. cPanelMichael

    cPanelMichael Technical Support Community Manager
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    44,749
    Likes Received:
    1,885
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    Hello @Zoltan Szabo,

    I'm glad to see the installation succeeded. I've marked this thread as solved.

    Thanks!
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  11. Nirjonadda

    Nirjonadda Well-Known Member

    Joined:
    May 8, 2013
    Messages:
    599
    Likes Received:
    15
    Trophy Points:
    68
    cPanel Access Level:
    Root Administrator
    @cPanelMichael Please can you let me know that what does mcrypt extension and why this support removed in php 7.2? So mcrypt extension no more used/needed or not important?
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  12. cPanelMichael

    cPanelMichael Technical Support Community Manager
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    44,749
    Likes Received:
    1,885
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    Hello @Nirjonadda,

    This was a decision made by the PHP development team. You can review the full details at:

    PHP: rfc:mcrypt-viking-funeral

    Thanks!
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  13. ad682005

    ad682005 Member

    Joined:
    Jan 8, 2018
    Messages:
    8
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    India
    cPanel Access Level:
    Website Owner
    Hi,

    I wanted to install mcrypt for PHP7.2 on cpanel and the above instructions seem to be godsent.

    However I am facing issues.. I am getting an error when i run the install libmcrypt command


    I get the error Requires: libc.so.6(GLIBC_2.14)(64bit)

    Note that I also did a yum install libc.so.6 and that installation was successful. Even after that yum install libmcrypt fails with same error message


    Refer below:

    [root@srv ~]# yum install libmcrypt

    Loaded plugins: fastestmirror, universal-hooks
    Setting up Install Process
    Loading mirror speeds from cached hostfile
    epel/metalink | 7.5 kB 00:00
    * EA4: 67.222.0.10
    * cpanel-addons-production-feed: 67.222.0.10
    * base: mirrors.123host.vn
    * epel: ftp.jaist.ac.jp
    * extras: mirrors.123host.vn
    * updates: mirrors.nhanhoa.com
    epel | 3.2 kB 00:00
    epel/primary | 3.5 MB 00:08
    epel 12584/12584
    Resolving Dependencies
    --> Running transaction check
    ---> Package libmcrypt.x86_64 0:2.5.8-13.el7 will be installed
    --> Processing Dependency: libc.so.6(GLIBC_2.14)(64bit) for package: libmcrypt-2 .5.8-13.el7.x86_64
    --> Finished Dependency Resolution
    Error: Package: libmcrypt-2.5.8-13.el7.x86_64 (epel)
    Requires: libc.so.6(GLIBC_2.14)(64bit)
    You could try using --skip-broken to work around the problem
    You could try running: rpm -Va --nofiles --nodigest
     
    #13 ad682005, Jun 2, 2018
    Last edited: Jun 2, 2018
  14. cPanelMichael

    cPanelMichael Technical Support Community Manager
    Staff Member

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

    I'm unable to reproduce this on a test system running CentOS 7 64-bit. Can you try running "yum update" first to make sure your existing packages are updated? Additionally, please let us know the output from the commands below:

    Code:
    rpm -qa|grep glibc
    ls -al /etc/yum.repos.d
    Thank you.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  15. ad682005

    ad682005 Member

    Joined:
    Jan 8, 2018
    Messages:
    8
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    India
    cPanel Access Level:
    Website Owner
    This is not an issue - I asked my component provider to send me update version of component so that I don't need mcrypt. Thanks so mcuh
     
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