在MAMP Mac系统上安装intl.so Extension

时间:2018-11-15 10:50:30

标签: php php-7 intl

所以我无法安装intl.so扩展,这是我的phpUnit测试所需的。我的系统

  • macOS Mojave
  • PHP 7.1.19安装在/ usr / bin / php

php -m | grep intl不返回任何内容。

所以我试图用以下方式安装intl

sudo /Users/beatgurtner/pear/bin/pecl install intl

此命令询问ICU路径:

Specify where ICU libraries and headers can be found [DEFAULT]

我键入:

/usr/local/Cellar/icu4c/62.1

最后出现错误:

configure: creating ./config.status config.status: creating config.h running: make /bin/sh /private/tmp/pear/install/pear-build-rootBSsAtU/intl-3.0.0/libtool --mode=compile cc -I/usr/local/Cellar/icu4c/62.1/include -Wno-write-strings -I. -I/private/tmp/pear/install/intl -DPHP_ATOM_INC -I/private/tmp/pear/install/pear-build-rootBSsAtU/intl-3.0.0/include -I/private/tmp/pear/install/pear-build-rootBSsAtU/intl-3.0.0/main -I/private/tmp/pear/install/intl -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -I/usr/local/Cellar/icu4c/62.1/include -DHAVE_CONFIG_H -g -O2 -c /private/tmp/pear/install/intl/php_intl.c -o php_intl.lo mkdir .libs cc -I/usr/local/Cellar/icu4c/62.1/include -Wno-write-strings -I. -I/private/tmp/pear/install/intl -DPHP_ATOM_INC -I/private/tmp/pear/install/pear-build-rootBSsAtU/intl-3.0.0/include -I/private/tmp/pear/install/pear-build-rootBSsAtU/intl-3.0.0/main -I/private/tmp/pear/install/intl -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -I/usr/local/Cellar/icu4c/62.1/include -DHAVE_CONFIG_H -g -O2 -c /private/tmp/pear/install/intl/php_intl.c -fno-common -DPIC -o .libs/php_intl.o In file included from /private/tmp/pear/install/intl/php_intl.c:25: /private/tmp/pear/install/intl/php_intl.h:23:10: fatal error: php.h file not found include <php.h> ^~~~~~~ 1 error generated. make: *** [php_intl.lo] Error 1 ERROR: make failed

我的xcode是最新的!

如何在Mac上安装具有intl扩展名的php7?!

感谢您的帮助!

更新:

我尝试过的其他解决方案对我不起作用:

pecl install memcached

https://stackoverflow.com/a/51265080/2839368

brew install php70-intl

https://stackoverflow.com/a/44523507/2839368

我从中得到的错误:

Error: No available formula with the name php71-intl ==> Searching for a previously deleted formula (in the last month)... Warning: homebrew/core is shallow clone. To get complete history run: git -C $(brew --repo homebrew/core) fetch --unshallow

Error: No previously deleted formula found. ==> Searching for similarly named formulae... Error: No similarly named formulae found. ==> Searching taps... ==> Searching taps on GitHub... Error: No formulae found in taps.

建议的另一件事: `curl -s https://php-osx.liip.ch/install.sh | bash -s 7.2 [警告] 检测到macOS Mojave 10.14。由于原始的Apache无法载入,因此存在严重问题 外国图书馆了。如果继续,apache中的PHP肯定将无法正常工作! CLI版本仍然会。 有关详细信息和讨论,请参见https://github.com/liip/php-osx/issues/249,此问题

所以什么都不起作用...请删除重复的标记!

解决方案: 好。因此有时可能很简单:我只是从以下位置下载了intl.so文件: https://github.com/skmedia/php-extensions-mamp/blob/master/php-5.4.4/intl.so并将其复制到/usr/lib/php/extensions/no-debug-non-zts-20160303

重新启动,现在可以使用...

0 个答案:

没有答案