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

Got the "mcrypt.h not found" error while compiling PHP? Find out how to easily fix it by installing the right packages for Debian, Ubuntu, CentOS.

While compiling PHP, we may run into several errors, mainly resulting from missing developer libraries; here's one of them:

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

To eliminate the above error, we install the following package:

  • Debian / Ubuntu : aptitude install libmcrypt-dev (32/64 bit)
  • RedHat / CentOS / Fedora : yum install libmcrypt-devel.x86_64 (64 bit) / yum install libc-client-devel (32 bit)