使用Xampp(MacOs)安装php intl的问题

前端之家收集整理的这篇文章主要介绍了使用Xampp(MacOs)安装php intl的问题前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我在我的Mac上安装了Xampp,最后一个版本是PHP7,一切正常,但在我的PHP项目中我使用了这个功能
numfmt_format_currency()

我需要安装intl,并使用以下行编辑PHP.ini:

extension="intl.so”

问题是,我无法安装intl,我使用这个命令:

sudo pecl install intl

但是给我这个控制台错误

/private/tmp/pear/temp/intl/intl_error.h:24:10: fatal error: 'ext/standard/PHP_smart_str.h' file not found
#include <ext/standard/PHP_smart_str.h>
         ^
1 error generated.
make: *** [PHP_intl.lo] Error 1
ERROR: `make' Failed

之后,我尝试从here下载ntl-3.0.0.tgz,并安装whith这个命令:

sudo pear install intl-3.0.0.tgz

但请回复我:

No releases available for package "pear.PHP.net/intl" - package pecl/intl can be installed with "pecl install intl"
install Failed

我很绝望,我怎么能安装intl?

您可以使用 https://php-osx.liip.ch/中的PHP包.它已包含intl扩展名.

This package installs the (usually) latest PHP 7.2/7.1/7.0/5.6/5.5/5.4/5.3 on OS X 10.6 (aka Snow Leopard),OS X 10.7 (aka Lion) and OS X 10.8 (aka Mountain Lion) and OS X 10.9 (aka Mavericks) and OS X 10.10 (aka Yosemite) and OS X 10.11 (aka El Capitan) and macOS 10.12 (aka Sierra) and macOS 10.13 (aka High Sierra) in /usr/local/PHP5. It installs many useful extensions (see below) and ini-settings and is what we at Liip use for our development. It’s especially suited for Symfony 2 development. It also provides a decent PHP.ini with all settings configured according to “Best Practices”.

PHP 7.2的安装是通过curl -s https://PHP-osx.liip.ch/install.sh |完成的bash -s 7.2.

有关更多信息,请查看网站和常见问题解答部分.

原文链接:https://www.f2er.com/php/136683.html

猜你在找的PHP相关文章