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/126.96.36.199/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
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: