Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

485
Vistas
Cannot install mcrypt with homebrew and php7.4

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 php@7.4).

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/php@7.4/bin/php-config --with-mcrypt' failed

Here is what I did:

  1. brew isntall mcrypt
  2. install the pecl
  3. sudo pecl install mcrypt -- The error goes here.

What I tried:

  1. Located the mcrypt.h and put manually the file to the several locations (based on the php-config), not work.

  2. Cleaned the brew and reinstall/relink the mcrypt(libmcrypt), not work.

  3. Removed the legacy mcrypt files of the old brew version.

over 4 years ago · Santiago Trujillo
2 Respuestas
Responde la pregunta

0

The problem here is the configure command can't find the libmcrypt installed by homebrew

You can

  1. Download the source code of mcrypt-1.0.4, then cd in the folder

  2. run "phpize"

  3. run "./configure --with-mcrypt=/opt/homebrew/Cellar/mcrypt/2.6.8", you can change the path here with your path for homebrew lib

  4. run "make && make install"

  5. add extension=mcrypt.so to your config file

ps: Use php -i | grep "Loaded Configuration File" to locate your php configure file

over 4 years ago · Santiago Trujillo Denunciar

0

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)"

over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda