Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

487
Visualizações
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 Respostas
Responde à pergunta

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 Relatório

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda