Question

How to install MCrypt PHP Extension on CentOS 7.0 x64

Posted September 18, 2014 158.7k views

I am using laravel framework. laravel project running requirement is MCrypt. i m trying to install but i m facing error

HTTP request sent, awaiting response… 404 Not Found
2014-09-18 13:25:27 ERROR 404: Not Found.

2 comments
  • yum install php-mcrypt

    Loaded plugins: fastestmirror

    Loading mirror speeds from cached hostfile

    base: centos.someimage.com

    extras: mirrors.mit.edu

    updates: mirror.lug.udel.edu

    No package php-mcrypt available.

    Error: Nothing to do

  • You can using EPEL (Extra Packages for Enterprise Linux) to install that.

    # install EPEL with yum
    yum -y install epel-release
    # install php-mcrypt
    yum -y install php-mcrypt
    

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

×
14 answers

use root user or sudo
wget http://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-5.noarch.rpm
rpm -ivh epel-release-7-5.noarch.rpm
yum install –enablerepo=“epel” php-mcrypt

wget http://dl.fedoraproject.org/pub/epel/beta/7/x86_64/epel-release-7-1.noarch.rpm

sudo yum install epel-release-7-1.noarch.rpm

yum install php-mcrypt*

restart Apache

sudo service httpd restart

Are you trying to install the REPL repository on your droplet? If so, try running the following commands:

wget http://dl.fedoraproject.org/pub/epel/beta/7/x86_64/epel-release-7-1.noarch.rpm
rpm -ivh epel-release-7-1.noarch.rpm
yum install --enablerepo="epel" php-mcrypt

Does that work?

Find and edit php.ini. On ubuntu its in /etc/php5/apache2/php.ini

Add this in php.ini

extension=mcrypt.so

Restart apache

wget http://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-2.noarch.rpm
rpm -ivh epel-release-7-2.noarch.rpm
yum install --enablerepo="epel" php-mcrypt

I managed to get it installed and working using the following commands…

sudo yum install epel-release
sudo yum install libmcrypt-devel

If you are running the default PHP installation you will want to run the following command as well…

sudo yum install php-mcrypt

digging an old thread, below are my results:

Error: Package: php-mcrypt-5.3.3-3.el6.x8664 (epel)
Requires: php(api) = 20090626
Installed: php-common-5.4.16-23.el7
0.3.x8664 (@updates)
php(api) = 20100412-64
Available: php-common-5.4.16-21.el7.x86
64 (base)
php(api) = 20100412-64
Available: php-common-5.4.16-23.el70.x8664 (updates)
php(api) = 20100412-64
Available: php-common-5.4.16-23.el70.1.x8664 (updates)
php(api) = 20100412-64
Error: Package: php-mcrypt-5.3.3-3.el6.x8664 (epel)
Requires: php(zend-abi) = 20090626
Installed: php-common-5.4.16-23.el7
0.3.x8664 (@updates)
php(zend-abi) = 20100525-64
Available: php-common-5.4.16-21.el7.x86
64 (base)
php(zend-abi) = 20100525-64
Available: php-common-5.4.16-23.el70.x8664 (updates)
php(zend-abi) = 20100525-64
Available: php-common-5.4.16-23.el70.1.x8664 (updates)
php(zend-abi) = 20100525-64
You could try using –skip-broken to work around the problem
You could try running: rpm -Va –nofiles –nodigest**

am thinking of writing off my whole project because of that, any help will be appreciated

Hi Jadoux
was wondering if you could fix your problem. I’m having the same error message ?
Thx

This might help, It works on me on my centos 7 x64
To install mcrypt just enter this command:
sudo yum install php-mcrypt.x86_64

To search for packages just do this command:
yum search php-

If you find the package that you’ve been looking for, and want to install it just do this command:
sudo yum install <package name>

[deleted]
  • Installed:
    epel-release.noarch 0:6-8

    Complete!
    root@souldeepvm [~]# yum -y install php-mcrypt
    Loaded plugins: fastestmirror
    Setting up Install Process
    Loading mirror speeds from cached hostfile

    Illegal instruction

    Still not able to install mcrypt

I am getting error .

[root@uploadr mcrypt]# wget http://dl.fedoraproject.org/pub/epel/beta/7/x86_64/e                                                                                    pel-release-7-1.noarch.rpm
--2016-10-10 20:06:05--  http://dl.fedoraproject.org/pub/epel/beta/7/x86_64/epel                                                                                        -release-7-1.noarch.rpm
Resolving dl.fedoraproject.org (dl.fedoraproject.org)... 209.132.181.26, 209.132                                                                                        .181.23, 209.132.181.24, ...
Connecting to dl.fedoraproject.org (dl.fedoraproject.org)|209.132.181.26|:80...                                                                                         connected.
HTTP request sent, awaiting response... 404 Not Found
2016-10-10 20:06:06 ERROR 404: Not Found.

[root@uploadr mcrypt]#

[root@server src]# wget http://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-2.noarch.rpm
–2019-01-11 14:04:05– http://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-2.noarch.rpm
Resolving dl.fedoraproject.org (dl.fedoraproject.org)… 209.132.181.24, 209.132.181.23
Connecting to dl.fedoraproject.org (dl.fedoraproject.org)|209.132.181.24|:80… connected.
HTTP request sent, awaiting response… 404 Not Found
2019-01-11 14:04:05 ERROR 404: Not Found.

[root@server src]# rpm -ivh epel-release-7-2.noarch.rpm
error: open of epel-release-7-2.noarch.rpm failed: No such file or directory
[root@server src]# yum install –enablerepo=“epel” php-mcrypt
Loaded plugins: changelog, fastestmirror
Loading mirror speeds from cached hostfile

  • base: mirror.checkdomain.de
  • epel: ftp.plusline.net
  • extras: mirror.checkdomain.de
  • updates: mirror.fra10.de.leaseweb.net No package php-mcrypt available. Error: Nothing to do

I can’t install =(. please help me… =( =( =(

PHP 7.2.14 > Directadmin > Centos 7.6.1810

[root@server ~]# wget http://dl.fedoraproject.org/pub/epel/beta/7/x86_64/epel-release-7-1.noarch.rpm
--2019-01-20 01:56:31--  http://dl.fedoraproject.org/pub/epel/beta/7/x86_64/epel-release-7-1.noarch.rpm
Resolving dl.fedoraproject.org (dl.fedoraproject.org)... 209.132.181.23, 209.132.181.24
Connecting to dl.fedoraproject.org (dl.fedoraproject.org)|209.132.181.23|:80... connected.
HTTP request sent, awaiting response... 404 Not Found
2019-01-20 01:56:31 ERROR 404: Not Found.

[root@server ~]# rpm -ivh epel-release-7-1.noarch.rpm
error: open of epel-release-7-1.noarch.rpm failed: No such file or directory
[root@server ~]# yum install --enablerepo="epel" php-mcrypt
Loaded plugins: changelog, fastestmirror, priorities
Loading mirror speeds from cached hostfile
 * base: mirror.checkdomain.de
 * epel: mirror.wiuwiu.de
 * extras: mirror.ratiokontakt.de
 * updates: mirror.wiuwiu.de
No package php-mcrypt available.
Error: Nothing to do
[root@server ~]# sudo yum install epel-release-7-1.noarch.rpm
Loaded plugins: changelog, fastestmirror, priorities
Loading mirror speeds from cached hostfile
 * base: mirror.checkdomain.de
 * epel: mirror.wiuwiu.de
 * extras: mirror.ratiokontakt.de
 * updates: mirror.wiuwiu.de
No package epel-release-7-1.noarch.rpm available.
Error: Nothing to do
[root@server ~]# yum install epel-release-7-1.noarch.rpm
Loaded plugins: changelog, fastestmirror, priorities
Loading mirror speeds from cached hostfile
 * base: mirror.checkdomain.de
 * epel: mirror.wiuwiu.de
 * extras: mirror.ratiokontakt.de
 * updates: mirror.wiuwiu.de
No package epel-release-7-1.noarch.rpm available.
Error: Nothing to do
[root@server ~]# yum install php-mcrypt*
Loaded plugins: changelog, fastestmirror, priorities
Loading mirror speeds from cached hostfile
 * base: mirror.checkdomain.de
 * epel: mirror.wiuwiu.de
 * extras: mirror.ratiokontakt.de
 * updates: mirror.wiuwiu.de
No package php-mcrypt* available.
Error: Nothing to do
[root@server ~]#
[root@server ~]# restart Apache
-bash: restart: command not found
[root@server ~]#
[root@server ~]# sudo service httpd restart
Redirecting to /bin/systemctl restart httpd.service

Hello, all

First you’ll need to add the EPEL and REMi repository:

sudo yum -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
sudo yum -y install https://rpms.remirepo.net/enterprise/remi-release-7.rpm

Then you go ahead and install the MCrypt extension:

sudo yum install php-mcrypt

If you haven’t installed PHP yet run this first:

sudo yum update

sudo yum install php php-cli

If you want to install the basic PHP extensions run this:

sudo yum install php php-cli php-fpm php-mysqlnd php-zip php-devel php-gd php-mcrypt php-mbstring php-curl php-xml php-pear php-bcmath php-json

The current PHP version should be 7.4. You can check the current verson using php -v

The expected output will be

$ php -v
PHP 7.4.0 (cli) (built: Nov 26 2019 20:13:36) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies

To view enabled modules, run:

php --modules or the short version php -m

Hope that this helps!
Regards,
Alex

  • I tried this on my install and i get an error about php-mcrypt:

    Package php-mcrypt-5.4.16-9.el7.x8664 is obsoleted by php-pecl-mcrypt-1.0.3-1.el7.remi.7.4.x8664 which is already installed

    php -v returns an error:

    php -v

    PHP Warning: PHP Startup: Unable to load dynamic library ‘mcrypt’ (tried: /usr/lib64/php/modules/mcrypt (/usr/lib64/php/modules/mcrypt: cannot open shared object file: No such file or directory), /usr/lib64/php/modules/mcrypt.so (libmcrypt.so.4: cannot open shared object file: No such file or directory)) in Unknown on line 0
    PHP 7.4.12 (cli) (built: Oct 27 2020 15:01:52) ( NTS )
    Copyright © The PHP Group
    Zend Engine v3.4.0, Copyright © Zend Technologies

    anyone have any ideas on what to do to resolve this?

    cheers

    • Hi,

      Would you mind running this command for me and sharing the output here:

      yum list installed | grep -i mcrypt

      As for the message itself, it’s self explanatory the .so file is missing. If you use sudo php -v the warning should not be displayed but it still needs to be sorted.

      You can open your php.ini file and define the .so extension:

      extension=mcrypt.so
      

      Hope that this helps!
      Regards,
      Alex

Submit an Answer