How to Enable INTL PHP Extension for MAMP on OSX 10.9.2

By Page Wood May 6, 2014

I’ve been running WordPress on MAMP for a couple of years now, but I encountered some issues when I needed to work with Laravel on my local. A basic Laravel setup is fine on MAMP, but my particular project dealt with foreign currencies, which required the International Extension for PHP, INTL for short. Here are the steps for enabling INTL for MAMP on OSX.

Note that at the time of installation, I was running OSX 10.9.2, and version 3.0.5 of MAMP with PHP 5.5.10. This also assumes that your $PATH variable is set to MAMP’s PHP.

1. Download ICU libraries and install to root

$ 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

 

2. Install autoconf

$ curl -OL http://ftpmirror.gnu.org/autoconf/autoconf-latest.tar.gz
$ tar xzf autoconf-latest.tar.gz
$ cd autoconf-*
$ ./configure --prefix=/usr/local
$ make && sudo make install

Or if you have Brew installed…

$ brew install autoconf

 

3. Create a symbolic link between MAMP and the directory containing your XCode php development headers.

$ ln -s /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/include /Applications/MAMP/bin/php/php5.5.10

Without this, I encountered some odd errors with incorrect paths in MAMP: “fatal error: ‘php.h’ file not found”

 

4. Install the PHP INTL extension with PECL

$ pecl install intl

 

5. Add extension=intl.so under the listed extensions in the PHP.ini file

If you’re using MAMP Pro, this is as easy as going to File -> Edit Template -> PHP -> PHP 5.5.10 php.ini. Otherwise, you will find this in Applications/MAMP/bin/php/php5.5.10/conf/php.ini

 

6. Restart MAMP and Terminal

That’s it, your changes should now be reflected. Hopefully this helps someone else out there!

 

Special thanks to the following for helping me figure out the steps above:


10 Comments

Validation Requirement for PHP CLI
Validation Requirement for PHP CLI
August 9, 2014 12:01 am

[…] http://pagegwood.com/web-development/how-to-enable-intl-extension-mamp-osx-10-9-2/ […]

Reply
Arun
Arun
October 15, 2014 5:29 pm

Worked like a charm! Thanks for this great post.

Reply
Page Wood
Page Wood
October 17, 2014 8:34 am

You're welcome! Glad to hear it worked out :)

Reply
Steven
Steven
May 11, 2015 10:34 pm

thanks for the info, much appreciated

Reply
Josh Crawmer
Josh Crawmer
June 9, 2015 7:44 am

Awesome tutorial! Thanks!

Reply
Rohan
Rohan
October 17, 2016 12:41 pm

Hey.. so all these steps worked fine on OSX Yosemite but for El Capitan i had to disable system integrity check. I found this reference here http://stackoverflow.com/questions/33220553/failed-to-write-error-when-installing-intl-extension-on-os-x-el-capitan

Thanks for the article though, and may be you can update it for the newer Mac versions.

Reply
Page Wood
Page Wood
November 5, 2016 5:28 pm

Hey Rohan, thanks for that info! Updating this article is on my to-do list. Stay tuned.

Reply
How to Enable INTL PHP Extension for MAMP on OSX 10.9.2 | blogcakephp
How to Enable INTL PHP Extension for MAMP on OSX 10.9.2 | blogcakephp
December 10, 2016 5:36 am

[…] (http://pagegwood.com/web-development/how-to-enable-intl-extension-mamp-osx-10-9-2/) […]

Reply
Stephan
Stephan
February 19, 2019 3:58 am

Hi there, I am using mamp on osx 10.14, but keep running into the error: make: *** [php_intl.lo] Error 1
ERROR: `make' failed

Did the steps above, but without success. Mamp version is: 5.2.2 and php version 7.3.0 (via mamp).

Reply
Tumenjargal
Tumenjargal
May 9, 2019 12:07 am

Thank you very much. It helps a lot

Reply

Leave a Comment