Installing intl for PHP on OS X

Pecl will only try to install PHP extensions in /usr. But OS X’s security model prevents that. This work-around works around the problem and installs extensions in different spot. This example is for intl, but this method should work for any extension.

pecl download intl
tar -xzf intl-3.0.0.tgz
cd intl-3.0.0/intl-3.0.0/
./configure --with-icu-dir=/usr/local/opt/icu4c
make -j4
make -j4 test
cp modules/ /usr/local/lib/blah/blah/blah/no-debug-non-zts-20121212/

Mangle /etc/php.ini and add

Restart apache and intl’s your uncle.