i am using rhel6 OS with php5 But i am unable to add mcrypt extension for php5.

Lots of Google but doesn't find any solution.

[root@lav6 modules]# locate mcrypt.so /usr/lib64/libmcrypt.so /usr/lib64/libmcrypt.so.4 /usr/lib64/libmcrypt.so.4.4.8 /usr/lib64/php/modules/mcrypt.so

[root@lav6 modules]# php -v PHP Warning: PHP Startup: Unable to load dynamic library '/opt/rh/php55/root/usr/lib64/php/modules/mcrypt.so' - /opt/rh/php55/root/usr/lib64/php/modules/mcrypt.so: cannot open shared object file: No such file or directory in Unknown on line 0 PHP 5.5.6 (cli) (built: Feb 21 2014 07:31:57) Copyright (c) 1997-2013 The PHP Group Zend Engine v2.5.0, Copyright (c) 1998-2013 Zend Technologies with Zend OPcache v7.0.3-dev, Copyright (c) 1999-2013, by Zend Technologies

Thanks in advance.

  • yum install php5-mcrypt Commented Sep 5, 2014 at 12:36

1 Answer 1


How did you install PHP 5.5 in the first place? Because the default PHP version in RHEL and CentOS 6 is PHP 5.3.3 and installing mcrypt support would than be as simple as installing the php-mcrypt package.

If you built PHP from source did you install the libmcrypt-devel rpm package beforehand and include mcrypt support in your ./configure options?

The native way to get updated versions for some web development components is via the RHEL Software Collections which you can enable much more easily on CentOS with:

yum install centos-release-SCL

But with regards to PHP that only gives you PHP 5.4.

A number of third party yum repositories provide PHP 5.5, such as Webtatic which provides mcrypt support in the php55w-mcrypt package.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .