phpmcryptcentos7

Where can I get php-mcrypt for PHP 7?


I've upgraded PHP to PHP 7 and am now seeing the following error Use of undefined constant MCRYPT_MODE_ECB. I am running CentOS 7 and having trouble updating php-mcrypt.

I found it on Arch Linux but am unfamiliar with Pacman and am having trouble setting it up.

Edit: This is where I am now. I've tried removing the installed packages to install the required but am having no such luck.

$ sudo yum install php*
Loaded plugins: fastestmirror
Cannot open: php-7.0.2-1.mga6.src.rpm. Skipping.
Examining php70-php-mcrypt-7.0.0-1.el7.remi.x86_64.rpm: php70-php-mcrypt-7.0.0-1.el7.remi.x86_64
Marking php70-php-mcrypt-7.0.0-1.el7.remi.x86_64.rpm to be installed
Examining php70-php-mcrypt-7.0.0-2.el6.remi.x86_64.rpm: php70-php-mcrypt-7.0.0-2.el6.remi.x86_64
Marking php70-php-mcrypt-7.0.0-2.el6.remi.x86_64.rpm to be installed
Loading mirror speeds from cached hostfile
* base: mirror.cs.pitt.edu
* epel: mirror.symnds.com
* extras: ftp.linux.ncsu.edu
* remi: mirrors.mediatemple.net
* remi-php56: mirrors.mediatemple.net
* remi-safe: mirrors.mediatemple.net
* updates: mirror.atlanticmetro.net
No package php-mcrypt-7.0.2-1-x86_64.pkg.tar.xz available.
Resolving Dependencies
--> Running transaction check
---> Package php70-php-mcrypt.x86_64 0:7.0.0-1.el7.remi will be installed
--> Processing Dependency: php70-php-common(x86-64) = 7.0.0-1.el7.remi for package: php70-php-mcrypt-7.0.0-1.el7.remi.x86_64
---> Package php70-php-mcrypt.x86_64 0:7.0.0-2.el6.remi will be installed
--> Processing Dependency: php70-php-common(x86-64) = 7.0.0-2.el6.remi for package: php70-php-mcrypt-7.0.0-2.el6.remi.x86_64
--> Finished Dependency Resolution
Error: Package: php70-php-mcrypt-7.0.0-1.el7.remi.x86_64 (/php70-php-mcrypt-7.0.0-1.el7.remi.x86_64)
Requires: php70-php-common(x86-64) = 7.0.0-1.el7.remi
Installed: php70-php-common-7.0.2-1.el7.remi.x86_64 (@remi)
php70-php-common(x86-64) = 7.0.2-1.el7.remi
Available: php70-php-common-7.0.1-1.el7.remi.x86_64 (remi)
php70-php-common(x86-64) = 7.0.1-1.el7.remi
Error: Package: php70-php-mcrypt-7.0.0-2.el6.remi.x86_64 (/php70-php-mcrypt-7.0.0-2.el6.remi.x86_64)
Requires: php70-php-common(x86-64) = 7.0.0-2.el6.remi
Installed: php70-php-common-7.0.2-1.el7.remi.x86_64 (@remi)
php70-php-common(x86-64) = 7.0.2-1.el7.remi
Available: php70-php-common-7.0.1-1.el7.remi.x86_64 (remi)
php70-php-common(x86-64) = 7.0.1-1.el7.remi
You could try using --skip-broken to work around the problem
You could try running: rpm -Va --nofiles --nodigest

Solution

  • sudo yum install php*
    

    This is terribly wrong, there are hundred of php packages, obviously not what you want.

    You should use a single PHP repository, and only install the needed packages (extensions / libraries)

    For "remi" repository, see the Wizard: http://rpms.remirepo.net/wizard/

    As you have php70-php-common-7.0.2-1.el7.remi.x86_64, you have to use exactly the same version, so php70-php-mcrypt-7.0.2-1.el7.remi.x86_64 (which is in "remi-safe" repository).