To install the Intl library for PHP in Mac, you need to install brew first.
Install Brew For ICU
First, update the brew
Search the ice package name.
brew search icu
You will find it like icu4c and install it.
brew install icu4c
Your icu4c path is
The version may not be the same. You can check the director at
After we got icu4c, we can install intl from the peel.
To install pear package, need to install Autoconf
brew install autoconf
Time to Install Pear
curl -O http://pear.php.net/go-pear.phar sudo php -d detect_unicode=0 go-pear.phar
Configure and Install PEAR
You should now be at a prompt to configure PEAR.
- Type 1 and press return.
- Type 4 and press return.
- Press return
After install pear, you can install
intl from peel.
$ sudo pecl update-channels $ sudo pecl install intl
After installing the intl, you just need to enable on php.ini.
sudo vim /etc/php.ini
Add extension like the following.
:wq (save and exit). After that, we need to restart the apache.
sudo apachectl restart
Now, you can check the intl library like following
php -m | grep intl # should return 'intl'