I have been trying to enable PHP 7.1 iMap extension on MAC Mojave 10.14.5, but I haven't had any luck getting it to work. Any help will be greatly appreciated.
Before any installation, php -v
returns 7.1.23
and which php
returns /usr/bin/php
since Mojave has PHP 7.1 preinstalled. However, php -m
doesn't include iMap since the extension is not installed by default.
I have tried to tap with either kabel/php-ext
orv1shky/php-ext
and brew install php@7.1-imap
, got the following in the installation process:
The php.ini and php-fpm.ini file can be found in:
/usr/local/etc/php/7.1/
php@7.1 is keg-only, which means it was not symlinked into /usr/local,
because this is an alternate version of another formula.
If you need to have php@7.1 first in your PATH run:
echo 'export PATH="/usr/local/opt/php@7.1/bin:$PATH"' >> ~/.bash_profile
echo 'export PATH="/usr/local/opt/php@7.1/sbin:$PATH"' >> ~/.bash_profile
For compilers to find php@7.1 you may need to set:
export LDFLAGS="-L/usr/local/opt/php@7.1/lib"
export CPPFLAGS="-I/usr/local/opt/php@7.1/include"**
And when I check, php -v
returns 7.1.30
, which php
returns /usr/local/bin/php
and php -m
still doesn't include iMap.
Then I followed the instruction to modify bash_profile, and now php -v
returns 7.1.30
and which php
returns /usr/local/opt/php@7.1/bin/php
. However, php -m
still doesn't include iMap.
Is there a better way to add the iMap extension for the existing PHP 7.1 that comes with Mojave? If not, is there anything else I should do when using HomeBrew so that it would work?
By the way, I have to stay on PHP 7.1 instead of upgrading to 7.2 or 7.3 due to some other frameworks we are using.
Thanks in advance!