doushi8231 2019-06-11 18:58
浏览 175

PHP 7.1 iMap扩展在Mojave上安装后不显示

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 or
v1shky/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!

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 LiBeAs的带隙等于0.997eV,计算阴离子的N和P
    • ¥15 关于#windows#的问题:怎么用WIN 11系统的电脑 克隆WIN NT3.51-4.0系统的硬盘
    • ¥15 来真人,不要ai!matlab有关常微分方程的问题求解决,
    • ¥15 perl MISA分析p3_in脚本出错
    • ¥15 k8s部署jupyterlab,jupyterlab保存不了文件
    • ¥15 ubuntu虚拟机打包apk错误
    • ¥199 rust编程架构设计的方案 有偿
    • ¥15 回答4f系统的像差计算
    • ¥15 java如何提取出pdf里的文字?
    • ¥100 求三轴之间相互配合画圆以及直线的算法