在Mac中安装PHP INTL的操作不正确 [英] Installing PHP INTL in mac not getting it right

查看:302
本文介绍了在Mac中安装PHP INTL的操作不正确的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经使用自制软件安装了php56-intl,如下所示:brew install php56-intl 当我执行php -m | grep intl时,它会给我intl

I have installed php56-intl using Homebrew like so: brew install php56-intl and when I do php -m | grep intl it gives me intl

但是当我检入phpinfo()文件时,没有显示intl.

But when I check in my phpinfo() file, doesn't show up intl.

不确定我想念什么.

更新

我要在计算机中安装intl的所有内容,以便可以运行zend应用程序.但是,无论我做什么,我都做不完.

All I want to install intl in my computer so that I could run my zend application. But whatever I do I don't get it done.

发生错误执行期间发生错误.请再试一遍 之后.

An error occurred An error occurred during execution; please try again later.

其他信息:

Zend \ I18n \ Exception \ ExtensionNotLoadedException文件: /Applications/XAMPP/xamppfiles/htdocs/skeleton/vendor/zendframework/zend-i18n/src/Filter/AbstractLocale.php:24

Zend\I18n\Exception\ExtensionNotLoadedException File: /Applications/XAMPP/xamppfiles/htdocs/skeleton/vendor/zendframework/zend-i18n/src/Filter/AbstractLocale.php:24

消息:

Zend \ I18n \ Filter组件需要intl PHP扩展名

Zend\I18n\Filter component requires the intl PHP extension

推荐答案

问题是,intl已安装在我的Mac中,但未安装在XAMPP中.

The problem was, intl was installed in my mac but not in XAMPP.

好吧,经过很长的麻烦之后,我如何成功:

Alright, after long hassle here how I succeeded:

转到您的终端并

cd /Applications/XAMPP/bin

然后php -m | grep intl,如果它返回intl,则说明已安装.如果未安装,则应返回empty.

Then php -m | grep intl, if it returns you intl then it is installed. If not installed then should return empty.

现在,sudo ./pecl install intl

会问specify where ICU libraries and headers can be found,只需按Enter键,

Will ask specify where ICU libraries and headers can be found, simply hit enter,

这将安装intl,也将返回此消息You should add "extension=intl.so" to php.ini.

And this will install intl, also will return this message You should add "extension=intl.so" to php.ini.

因此,只需将其添加到您的php.ini文件中,然后重新启动apache:sudo apachectl restart或从XAMPP本身进行硬重启.

So simply add this to your php.ini file and restart your apache: sudo apachectl restart or hard restart from XAMPP itself.

希望这对其他人有帮助.

Hope this helps someone else.

这篇关于在Mac中安装PHP INTL的操作不正确的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆