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!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

mcrypt php extension

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

  1. Nirjonadda

    Nirjonadda Well-Known Member

    Joined:
    May 8, 2013
    Messages:
    574
    Likes Received:
    14
    Trophy Points:
    18
    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
     
    #1 Nirjonadda, Dec 6, 2017
    Last edited: Dec 6, 2017
  2. cPanelKenneth

    cPanelKenneth cPanel Development
    Staff Member

    Joined:
    Apr 7, 2006
    Messages:
    4,554
    Likes Received:
    41
    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.
     
  3. Miguel G

    Miguel G Well-Known Member

    Joined:
    Jun 4, 2015
    Messages:
    63
    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 Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    42,802
    Likes Received:
    1,714
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    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.
     
  5. Zoltan Szabo

    Zoltan Szabo Member

    Joined:
    Jul 13, 2017
    Messages:
    20
    Likes Received:
    4
    Trophy Points:
    3
    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 Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    42,802
    Likes Received:
    1,714
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    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.
     
  7. Zoltan Szabo

    Zoltan Szabo Member

    Joined:
    Jul 13, 2017
    Messages:
    20
    Likes Received:
    4
    Trophy Points:
    3
    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 Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    42,802
    Likes Received:
    1,714
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    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.
     
Loading...

Share This Page