configure: error: mcrypt.h not found. Please reinstall libmcrypt

On Centos6/7, when compile PHP from source:

configure: error: mcrypt.h not found. Please reinstall libmcrypt

To fix this:

yum update epel-release
yum install -y libmcrypt-devel

or if it doesn’t work, use epel-release from Fedora:

rpm -ivh https://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
yum install -y libmcrypt-devel

 

 

 

configure: error: mcrypt.h not found. Please reinstall libmcrypt