How to Enable INTL PHP Extension for MAMP on OSX 10.9.2

By Page Wood May 06, 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:


12 Comments

  1. Validation Requirement for PHP CLI
    Validation Requirement for PHP CLI
    Reply
  2. Arun
    Arun

    Worked like a charm! Thanks for this great post.

    Reply
    • Page Wood
      Page Wood

      You’re welcome! Glad to hear it worked out 🙂

      Reply
  3. Steven
    Steven

    thanks for the info, much appreciated

    Reply
  4. Josh Crawmer
    Josh Crawmer

    Awesome tutorial! Thanks!

    Reply
  5. Rohan
    Rohan

    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

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

      Reply
  6. 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
    Reply
  7. Stephan
    Stephan

    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
  8. Tumenjargal
    Tumenjargal

    Thank you very much. It helps a lot

    Reply
  9. Cake PHP: Como instalei no Mac? | Daniela Maksoud
    Cake PHP: Como instalei no Mac? | Daniela Maksoud

    […] Fonte: How to Enable INTL PHP Extension for MAMP on OSX 10.9.2 […]

    Reply
  10. Jose Paniagua
    Jose Paniagua

    Hello, this can sound like a very newbie question but I’m doing my first steps with php and trying to work with cake php framework.

    While trying to install intl through pecl (right in step 4) I’m asked for where the ICU libraries and headers can be found, I infer that I should point this to the place where my binaries are downloades, right?

    If I’m right, after I hit enter I get a message “ERROR: `/private/tmp/pear/temp/intl/configure –with-php-config=/usr/local/opt/php/bin/php-config –with-icu-dir=DEFAULT’ failed”

    Will you be so kind to tell me if these ever happened to you or maybe you know how to solve it?

    Reply

Leave a Comment

Leave a Reply

Your email address will not be published. Required fields are marked *