I\'ve asked the system admins to install mcrypt on the server, and they say everything is OK. But when I run my simple script I get this.
Warning
Architecture: Centos 6 / Apache 2.2 / Dual PHP installation (5.3 and 5.4)
UPDATE: This solution explains how to install the module mcrypt with PHP 5.4 manually from Remi's RPM on Centos 6, but this RPM requires glibc-2.14+, so this only is not enough to make it work, if your glibc is older than that.
In my configuration, Yum install php-mcrypt*
showed as installed the version for 5.3
in normal root:
php-mcrypt.x86_64 5.3.3-5.el6 @epel
However, 5.4 is chrooted in /opt/rh/php54
Simply copying the 5.3 modules and config files does not work. The module fails initialization, that's why it does not appear in phpinfo(), this can be checked with
/opt/rh/php54/root/usr/bin/php -v
The solution that worked for me is to download the Remi's RPM (although it's normally easier to install it by adding his Yum repository as discussed in the Comments) (https://www.rpmfind.net/linux/RPM/remi/fedora/25/x86_64/php54-php-mcrypt-5.4.45-12.fc25.remi.x86_64.html)
wget ftp://fr2.rpmfind.net/linux/remi/fedora/25/remi/x86_64/php54-php-mcrypt-5.4.45-12.fc25.remi.x86_64.rpm
extract the files with RPM2CPIO:
rpm2cpio php54-php-mcrypt-5.4.45-12.fc25.remi.x86_64.rpm |cpio -idmv
./opt/remi/php54/root/etc/php.d/mcrypt.ini
./opt/remi/php54/root/usr/lib64/php/modules/mcrypt.so
98 blocks
And copy to the chroot folder
cp ./opt/remi/php54/root/etc/php.d/mcrypt.ini /opt/rh/php54/root/etc/php.d/mcrypt.ini
cp ./opt/remi/php54/root/usr/lib64/php/modules/mcrypt.so /opt/rh/php54/root/usr/lib64/php/modules/
To check:
/opt/rh/php54/root/usr/bin/php -v
And also: