bash-3.2$ brew update
Already up-to-date.
bash-3.2$ brew doctor
Your system is ready to brew
$ brew install php71-mcrypt
Error: No available formula with the name "php71-mcrypt"
==> Searching for a previously deleted formula (in the last month)...
Error: No previously deleted formula found.
==> Searching for similarly named formulae...
==> Searching local taps...
Error: No similarly named formulae found.
==> Searching taps...
==> Searching taps on GitHub...
Error: No formulae found in taps.
I was able to install php71 just fine. Any advice? I haven't had this problem before.
FYI I see that mcrypt it supposed to be in the homebrew/core php71, but I am getting this error:
$ which php
/usr/local/opt/[email protected]/bin/php
$ php -m
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/local/Cellar/[email protected]/7.1.16/lib/php/20160303/mcrypt.so' - dlopen(/usr/local/Cellar/[email protected]/7.1.16/lib/php/20160303/mcrypt.so, 9): image not found in Unknown on line 0
Warning: PHP Startup: Unable to load dynamic library '/usr/local/Cellar/[email protected]/7.1.16/lib/php/20160303/mcrypt.so' - dlopen(/usr/local/Cellar/[email protected]/7.1.16/lib/php/20160303/mcrypt.so, 9): image not found in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/local/opt/php71-mcrypt/mcrypt.so' - dlopen(/usr/local/opt/php71-mcrypt/mcrypt.so, 9): image not found in Unknown on line 0
I also tried reinstalling php71 from the source and if i do php -m, i see mcrypt but i do see those errors. it seems like it does not have that mcrypt.so file.
Right. It's included built-in statically. Just remove the ini
I just wrote similar problem and solution with php71-intl: https://github.com/Homebrew/homebrew-core/issues/26203#issue-311482765
@ilovezfs
Where can you see that it is built-in statically? As I can't see the flag (should there be a flag?) in the formula. https://github.com/Homebrew/homebrew-core/blob/master/Formula/php.rb
Do you know now how to install php-redis? It is a while since I have compiled PHP from source.
I checked out the source and couldn't find the option either
./configure --help | grep mcrypt
./configure --help | grep redis
@alexbiddle run php -m to see what extensions are installed. As for redis, you can/should get that from pecl
@SMillerDev thanks, pecl install redis works.
php -m | grep mcrypt shows no results.
@alexbiddle what does php -v show? Because for 7.2 it isn't included (for obvious reasons)
@SMillerDev
PHP 7.2.4 (cli) (built: Apr 5 2018 11:09:55) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
with Zend OPcache v7.2.4, Copyright (c) 1999-2018, by Zend Technologies
However I have installed mcrypt now via
brew install mcrypt and
pecl install -f mcrypt (-f as it initially refused to install snapshot)
@ilovezfs Thank you, that resolved my issue. I understand now. Was this a change on php's end to just include mcrypt by default? I hadn't heard about this
Hey there, after upgrading with brew upgrade my php71 installation broke. After some research and wild reinstall, prune, link --force and other commands I managed to get it back working. But the message PHP Startup: Unable to load dynamic library '/usr/local/opt/php71-mcrypt/mcrypt.so' is still there. I looked in the loaded .ini file but there is no line which loads mcrypt. So what do I have to do to remove this message?
EDIT Found it under /usr/local/etc/php/7.1/conf.d/ext-mcrypt.ini
Hi @pr4xx, check this file /usr/local/etc/php/7.1/conf.d/ext-mcrypt.ini, it was also loading the mcrypt.so on my machine so I commented that out and it resolved the issue. Check php -m after to verify the mcrypt is still loaded though.
Most helpful comment
Hi @pr4xx, check this file /usr/local/etc/php/7.1/conf.d/ext-mcrypt.ini, it was also loading the mcrypt.so on my machine so I commented that out and it resolved the issue. Check php -m after to verify the mcrypt is still loaded though.