MAC下安装ICU和PHP INTL 扩展
我使用的Mavericks自带的php,没有安装MAMP。
首先我们需要安装一个brew,这个网上有很多这方面的帖子。
先安装Git,打开一个shell
cd/usr/local
sudo mkdir homebrew
curl-L https://github.com/mxcl/homebrew/tarball/master | sudo tar xz --strip 1 -C homebrew
cd homebrew/bin
./brew -v
file brew
cat brew | more
sudo ./brew update
如果“brew update”命令执行出错,请确保文件夹/usr/local的所有者权限是你本人而不是root:
sudo chown $USER /usr/localbrew updat
在".bash_profile"中更新路径配置
(如果~下没有文件".bash_profile"请执行: touch '.bash_profile' )
vim'.bash_profile'加入
exportPATH=$PATH:/usr/local/homebrew/bin
之后可以直接执行brew(不用./brew)
如果有了Git可以这样安装(未测试)
git clone https://github.com/mxcl/homebrew.git
cd homebrew/bin
cd homebrew/bin
./brew -v
到这里就安装好了brew了
2.然后使用brew安装ICU
打开命令行: brew install icu4c
3.然后开启你的pear
sudophp/usr/lib/php/install-pear-nozlib.phar
sudopearconfig-setphp_ini/private/etc/php.ini
sudopeclconfig-setphp_ini/private/etc/php.ini
sudopearupgrade-all
4.安装intl
sudo pecl install intl
在这个过程中,需要你输入ICU的地址,这里就输入/usr/local/homebrew/opt/icu4c (这个地方注意了,需要用到你brew的路径)。
好了去修改你的php.ini 添加 extension=intl.so吧。
声明:本站所有文章资源内容,如无特殊说明或标注,均为采集网络资源。如若本站内容侵犯了原著者的合法权益,可联系本站删除。