First we’ll need to install any dependencies. To quote the intl package description:
“The Internationalization extension exposes functionality of the ICU library to PHP”.
The ICU Libraries is our only dependency. If you have Homebrew installed you can use that; alternatively, you can download and compile from source.
Using homebrew:
$ brew update
$ brew search icu# returns 'icu4c'
Success. Install:
$ brew install icu4c
A couple of minutes to download and compile, and ICU is installed. PECL will prompt you for the path where the header files and stuff were installed; on my machine this was:
/usr/local/Cellar/icu4c/56.1/
$brew install homebrew/php/php56-intl
Restart apache
$sudo apachectl restart
Finally, check that the module is registered:
$ php -m | grep intl
# should return 'intl'
The second way using phpinfo()
参考链接地址:http://darraghenright.tumblr.com/post/22027208929/installing-intl-package-on-osx-lion