• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Adding mcrypt extension to php on plesk 11

SébastienD

New Pleskian
HEllo,

I would like to install mcrypt extension on my server and i don't find procedure . If someone could help me

My version is :
OS CentOS 6.3 (Final)
Version de Parallels Panel 11.0.9 Mettre à jour #36, dernière mise à jour à Fév 8, 2013 06:32 PM

thx,
Seabstien
 

Thanks, eilko! That answered the question perfectly!

FTR: The php-mcrypt package is available (for Centos, Scientific Linux, and Oracle Linux administrators) from the RPMforge repository (a.k.a. Dag's repository) and from the EPEL repository. To add the RPMforge repo to your Centos, Scientific Linux, or Oracle Linux system...

Code:
[root@www ~]# rpm --import http://apt.sw.be/RPM-GPG-KEY.dag.txt

[root@www ~]# rpm -Uvh http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.2-2.el6.rf.i686.rpm
Preparing...                ########################################### [100%]
   1:rpmforge-release       ########################################### [100%]

[root@www ~]# yum repolist
Loaded plugins: downloadonly, fastestmirror, priorities, security
Determining fastest mirrors
 * base: centos.mirror.netriplex.com
 * extras: mirror.nexcess.net
 * rpmforge: mirror.teklinks.com
 * updates: ftp.linux.ncsu.edu
repo id                                                                     repo name                                                                                      status
base                                                                        CentOS-6 - Base                                                                                6,381
extras                                                                      CentOS-6 - Extras                                                                                 12
rpmforge                                                                    RHEL 6 - RPMforge.net - dag                                                                    4,594
updates                                                                     CentOS-6 - Updates                                                                               458
repolist: 11,445

[root@www ~]# yum search php-mcrypt
Loaded plugins: downloadonly, fastestmirror, priorities, security
Loading mirror speeds from cached hostfile
 * base: centos.mirror.netriplex.com
 * extras: mirror.nexcess.net
 * rpmforge: mirror.teklinks.com
 * updates: ftp.linux.ncsu.edu
======================= N/S Matched: php-mcrypt =======================
php-mcrypt.x86_64 : Standard PHP module provides mcrypt library support

Installing the php-mcrypt package does not quite fix the problem, however, because even though the package contains the module Apache does not load the module:

Code:
[root@www ~]# rpm -ql php-mcrypt
[COLOR="#00FF00"]/etc/php.d/mcrypt.ini
/usr/lib64/php/modules/mcrypt.so[/COLOR]

[root@www ~]# cat /etc/php.d/mcrypt.ini 
; Enable mcrypt extension module
[COLOR="#FF0000"]extension=module.so[/COLOR]

[root@www ~]# ls -1 --classify /usr/lib64/php/modules/
curl.so*
dom.so*
fileinfo.so*
gd.so*
imap.so*
ioncube_loader_lin_5.1.so
ioncube_loader_lin_5.2.so
ioncube_loader_lin_5.3.so
json.so*
mbstring.so*
[COLOR="#00FF00"]mcrypt.so*[/COLOR]
mysqli.so*
mysql.so*
pdo_mysql.so*
pdo.so*
pdo_sqlite.so*
phar.so*
sqlite3.so*
sw-engine/
wddx.so*
xmlreader.so*
xmlwriter.so*
xsl.so*
zip.so*

[root@www ~]# apachectl -t -D DUMP_MODULES | grep php
 php5_module (shared)
Syntax OK

[root@www ~]# apachectl -t -D DUMP_MODULES | grep crypt
Syntax OK

In order to force Apache to load the mcrypt.so module, I had to modify the mcrypt.ini file, restart Apache, and check the output of the phpinfo() subroutine:

Code:
[root@www ~]# cat /etc/php.d/mcrypt.ini 
; Enable mcrypt extension module
[COLOR="#FF0000"]extension=module.so[/COLOR]

[root@www ~]# wget -qO- http://rocket-powered.com/info.php | grep -i mcrypt
/etc/php.d/mcrypt.ini,

[root@www ~]# vi /etc/php.d/mcrypt.ini

[root@www ~]# /etc/init.d/httpd restart
Stopping httpd:                                            [  [COLOR="#00FF00"]OK[/COLOR]  ]
Starting httpd:                                            [  [COLOR="#00FF00"]OK[/COLOR]  ]

[root@www ~]# cat /etc/php.d/mcrypt.ini 
; Enable mcrypt extension module
[COLOR="#00FF00"]extension=mcrypt.so[/COLOR]

[root@www ~]# apachectl -t -D DUMP_MODULES | grep crypt
Syntax OK

[root@www ~]# wget -qO- http://rocket-powered.com/info.php | grep -i mcrypt | html2text 
/etc/php.d/mcrypt.ini,
Registered Stream Filters
zlib.*, bzip2.*, convert.iconv.*, string.rot13, string.toupper, string.tolower,
string.strip_tags, convert.*, consumed, dechunk, mcrypt.*, mdecrypt.*
***** mcrypt *****
mcrypt support
enabled
mcrypt_filter support
enabled
mcrypt.algorithms_dir
no value
no value
mcrypt.modes_dir
no value
no value

For more information about additional CentOS repositories and YUM:


HTH,
 
Last edited:
You can try with atomic respitory:

# wget -q -O - http://www.atomicorp.com/installers/atomic.sh | sh
# yum install php-mcrypt

Hi.. I resume this old post. Everything ok, no probem in this procedure. But now I have in my plesk 11.5 the version PHP 5.4.23 and no the version PHP 5.3.3 that plesk installed by default. PHP version 5.3.3 is overwritten?

Is this normal?

Thanks and happy new year 2014

__________________
Andrea
 
Some facts about this post:

Edit: The solution is at the end, a Stack Exchange post.

1. This is a fairly old post. I find it ironic that mcrypt is not enabled by default on my PPA system because, after all, my customers simply followed the APS Applications installer to get Magento working. It fails with "The 'mcrypt' extension was not found.".

2. If you were wondering about the screencast of @Dx3webs, yes indeed the actual message is when moving over to @IgorG might get you in serious trouble down the road. The actual message of the screencast is:

"WARNING: Third-party Yum repository 'varnish-3.0' is enabled, installation may fail.
WARNING: Third-party Yum repository 'atomic' is enabled, installation may fail.

Since you use one or more 3rd-party repos (say, atomic), be careful when installing different package versions from different repos as this may lead to installation failures. For example, you may encounter a problem if you first installed PHP from a 3rd-party repo and then upgrade it using the Parallels repo. To avoid such situations, install and upgdare packages from the same repo."

PS. The actual message include the typo "upgdare".

3. From what I recall years ago Atomic is a reliable source - he apparently used to work for SWSoft back in the days. So I decided to give @IgorG's method a go:

(I've left out some of the major text to include only relevant parts)

[root@web1 home]# wget -q -O - http://www.atomicorp.com/installers/atomic.sh | sh

Atomic Free Unsupported Archive installer, version 2.0.11

BY INSTALLING THIS SOFTWARE AND BY USING ANY AND ALL SOFTWARE
PROVIDED BY ATOMICORP LIMITED YOU ACKNOWLEDGE AND AGREE:

...

====================================================================
THIS SOFTWARE IS UNSUPPORTED. IF YOU REQUIRE SUPPORTED SOFWARE
PLEASE SEE THE URL BELOW TO PURCHASE A NUCLEUS LICENSE AND DO NOT
PROCEED WITH INSTALLING THIS PACKAGE.
====================================================================


For supported software packages please purchase a Nucleus license:
https://www.atomicorp.com/products/nucleus.html
All atomic repository rpms are UNSUPPORTED.
Do you agree to these terms? (yes/no) [Default: yes] yes

Configuring the [atomic] yum archive for this system

Installing the Atomic GPG key: OK
Downloading atomic-release-1.0-18.el6.art.noarch.rpm: OK



The Atomic Rocket Turtle archive has now been installed and configured for your system
The following channels are available:
atomic - [ACTIVATED] - contains the stable tree of ART packages
atomic-testing - [DISABLED] - contains the testing tree of ART packages
atomic-bleeding - [DISABLED] - contains the development tree of ART packages


[root@web1 home]# yum install php-mcrypt
Loaded plugins: fastestmirror, priorities, security
Loading mirror speeds from cached hostfile
* atomic: www7.atomicorp.com
* base: www.ftp.saix.net
* extras: www.ftp.saix.net
* updates: www.ftp.saix.net
atomic | 1.9 kB 00:00
atomic/primary_db | 1.1 MB 00:01
170 packages excluded due to repository priority protections
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package php-mcrypt.x86_64 0:5.4.25-31.el6.art will be installed
--> Processing Dependency: php-common(x86-64) = 5.4.25-31.el6.art for package: php-mcrypt-5.4.25-31.el6.art.x86_64
--> Running transaction check
---> Package php-common.x86_64 0:5.3.3-23.el6_4 will be updated
--> Processing Dependency: php-common(x86-64) = 5.3.3-23.el6_4 for package: php-imap-5.3.3-23.el6_4.x86_64
--> Processing Dependency: php-common(x86-64) = 5.3.3-23.el6_4 for package: php-cli-5.3.3-23.el6_4.x86_64
--> Processing Dependency: php-common(x86-64) = 5.3.3-23.el6_4 for package: php-mbstring-5.3.3-23.el6_4.x86_64

...

Dependencies Resolved

===============================================================================================================================================================================================================================
Package Arch Version Repository Size
===============================================================================================================================================================================================================================
Installing:
php-mcrypt x86_64 5.4.25-31.el6.art atomic 49 k
Installing for dependencies:
t1lib x86_64 5.1.2-6.el6_2.1 base 160 k
Updating for dependencies:
openssl i686 1.0.1e-16.el6_5.4 updates 1.5 M
openssl x86_64 1.0.1e-16.el6_5.4 updates 1.5 M
php x86_64 5.4.25-31.el6.art atomic 2.7 M
php-cli x86_64 5.4.25-31.el6.art atomic 2.6 M
php-common x86_64 5.4.25-31.el6.art atomic 927 k
php-gd x86_64 5.4.25-31.el6.art atomic 142 k
php-imap x86_64 5.4.25-31.el6.art atomic 78 k
php-mbstring x86_64 5.4.25-31.el6.art atomic 943 k
php-mysql x86_64 5.4.25-31.el6.art atomic 135 k
php-pdo x86_64 5.4.25-31.el6.art atomic 119 k
php-xml x86_64 5.4.25-31.el6.art atomic 169 k

Transaction Summary
===============================================================================================================================================================================================================================
Install 2 Package(s)
Upgrade 11 Package(s)

Total download size: 11 M
Is this ok [y/N]:


As you can see, if you install Atomic repos you may be irrecoverably changing your server to a new PHP version from a 3rd party source. You are installing unsupported software. My guess is, if you log a ticket because things start going horribly wrong, you will be told "3rd party repo - sorry".

4. My advice find some other way to get it working with your existing install.

EDIT:

This worked:
http://stackoverflow.com/questions/17109818/install-php-mcrypt-on-centos6
 
Last edited:
The warning does sound dire... Having said that you can safely build your servers on the atomic repo without any issues.
 
Hi again,

After installing that mcrypt module some time back (see above) we've noticed that the plesk control panel (parallels 11.0.9 CentOS 6.3) won't auto update, throwing the following error:

WARNING: Third-party Yum repository 'atomic' is enabled, installation may fail.

The hosting company advised:
In general we suggest, and recommend, that you do not use the Atomic Repository on any Plesk controlled servers, as those repositories are generally incompatible - as per the error. You would need to remove/disable the Atomic repo in order to proceeded with the Plesk Panel update - however note that as you have already had the repo enabled, and possibly installed packages from it, disabling the repo may break functionality overall; you will need to investigate to see if this is the case.

I really need some advice as to how to proceed. I want the plesk control panel to auto update correctly but at present this means (according to the above) disabling Atomic. We need mcrypt for our site to function correctly so I'm hesitant to do that. My knowledge in this area is lacking so I'd appreciate any advice that any one may be able to offer.

Many thanks in advance
 
Dont panic.

This can happen if for some reason atomic cant update. This means when plesk tries to upgrade components Yum fails on atomic installed components.

you can find out what the issue is by running

yum upgrade php

from the command line. I suspect the warning you get will be for outdated keys.

There are a couple of this you may need to try to fix this.

either run:

wget -q -O - http://www.atomicorp.com/installers/atomic | sh

again which may do the trick or

yum update atomic-release

or

yum clean all


in that order. Then test with

yum upgrade php

or similar. This should run smoothly now allowing you to upgrade plesk

Despite the warnings atomic is still a great way to keep your servers up to date.
 
Back
Top