Robin van der Vleuten

Install the intl PHP extension in MAMP

If you build Symfony applications, you will run into translations sooner or later. The translation component needs the PHP intl extension, which may require a little extra setup in MAMP.

First, grab the ICU libraries and build them:

bash
$ curl -O http://download.icu-project.org/files/icu4c/4.8.1.1/icu4c-4_8_1_1-src.tgz
$ tar xzvf icu4c-4_8_1_1-src.tgz
$ cd icu/source
$ ./runConfigureICU MacOSX
$ make && sudo make install

Now install the PHP intl extension with PECL. Make sure the MAMP PHP binary directory is in your $PATH, then run:

bash
$ pecl install intl

Finally, add extension=intl.so to your php.ini file. Restart your shell and MAMP so they pick up the change.