Centos – Errors installing php extensions on Centos 7

centosPHPrepositoryyum

I'm pretty sure I know what the problem is i just dont know how to fix it.

Im trying to install mcrypt "yum install php-mcrypt" and i get the following error

Error: Package: php-mcrypt-5.3.3-3.el6.x86_64 (epel)

I can see that el6 is the error. I have php el7 installed already. How can i get the el7 version instead of el6?

I checked the current repolist and i dont see any el6 repos there. The current active repos are

CentOS-7 - Base 
Extra Packages for Enterprise Linux 7 - x86_64     
CentOS-7 - Extras    
MySQL Connectors Community    
MySQL Tools Community - Source  
MySQL 5.6 Community Server  
CentOS-7 - Updates 

Yum error when running yum install php-mcrypt

--> Finished Dependency Resolution
Error: Package: php-mcrypt-5.3.3-3.el6.x86_64 (epel)
   Requires: php(api) = 20090626
   Installed: php-common-5.4.16-23.el7_0.3.x86_64 (@base)
       php(api) = 20100412-64
Error: Package: php-mcrypt-5.3.3-3.el6.x86_64 (epel)
   Requires: php(zend-abi) = 20090626
   Installed: php-common-5.4.16-23.el7_0.3.x86_64 (@base)
   php(zend-abi) = 20100525-64

Best Answer

You installed the EPEL repository for CentOS 6, but you are actually running CentOS 7.

Remove the epel-release RPM, and reinstall the correct RPM. Once you have done so, run yum clean metadata to clean out any old metadata relating to the wrong version of EPEL.