OS: macOS 11 (big sur)
Homebrew: 2.5.12
PEAR Version: 1.10.12
I just upgraded the php on my mac from php7.1 to php7.4 with homebrew (brew install [email protected]).
Then, when I try to install mcrypt extension, I got the error:
configure: error: mcrypt.h not found. Please reinstall libmcrypt.
ERROR: `/private/tmp/pear/install/mcrypt/configure --with-php-config=/usr/local/homebrew/opt/[email protected]/bin/php-config --with-mcrypt' failed
Here is what I did:
What I tried:
Located the mcrypt.h and put manually the file to the several locations (based on the php-config), not work.
Cleaned the brew and reinstall/relink the mcrypt(libmcrypt), not work.
Removed the legacy mcrypt files of the old brew version.
You can install Mcrypt from the PHP Source Tree as a module if you choose. Enable the module by adding: 'extension=mcrypt.so' to PHP. ini. Done!
The mcrypt extension has been abandonware for nearly a decade now, and was also fairly complex to use. It has therefore been deprecated in favour of OpenSSL, where it will be removed from the core and into PECL in PHP 7.2.
You can also achieve this same screen by viewing a php file that has: phpinfo(); somewhere in the code. In this screen, simply search for the string "mcrypt support". If installed, you will see a box that says "enabled".
I ran into the same problem. So after installing libmcrypt with brew install mcrypt
it seems like configure is not able to resolve the path to mcrypt.h automatically. It also does not work to specify the CPPFLAGS or giving the homebrew include path.
But I found a solution that works for me by giving pecl the install location of mcrypt in the Homebrew Cellar. This is what the following code does automatically:
pecl install mcrypt <<<"$(ls -d $(brew --prefix)/Cellar/mcrypt/* | tail -1)"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With