SOLVED mcrypt php extension

Nirjonadda

Well-Known Member
May 8, 2013
655
16
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
 
Last edited:

cPanelKenneth

cPanel Development
Staff member
Apr 7, 2006
4,575
48
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.
 

cPanelMichael

Technical Support Community Manager
Staff member
Apr 11, 2011
47,902
2,227
363
cPanel Access Level
DataCenter Provider
Twitter
How does this affect software as Wordpress? How do we enable mcrypt for php 7.2 using PECL without breaking EasyApache 4?
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.
 

Zoltan Szabo

Active Member
Jul 13, 2017
41
7
8
Hungary
cPanel Access Level
Root Administrator
Hello,

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.
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:
[email protected] [~]# /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
 

cPanelMichael

Technical Support Community Manager
Staff member
Apr 11, 2011
47,902
2,227
363
cPanel Access Level
DataCenter Provider
Twitter
I tried to setup mcyrpt php extension to php 7.2 on cpanel module installers page.
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

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
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.
 

Zoltan Szabo

Active Member
Jul 13, 2017
41
7
8
Hungary
cPanel Access Level
Root Administrator
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.
Did land on an error:
Code:
[email protected] [~]# 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
 

Zoltan Szabo

Active Member
Jul 13, 2017
41
7
8
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
 
  • Like
Reactions: cPanelMichael

cPanelMichael

Technical Support Community Manager
Staff member
Apr 11, 2011
47,902
2,227
363
cPanel Access Level
DataCenter Provider
Twitter

ad682005

Member
Jan 8, 2018
14
2
3
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:

[[email protected] ~]# 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
 
Last edited:

cPanelMichael

Technical Support Community Manager
Staff member
Apr 11, 2011
47,902
2,227
363
cPanel Access Level
DataCenter Provider
Twitter
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
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.