Skip to content

Instantly share code, notes, and snippets.

@toopay
Last active August 3, 2021 17:54
Show Gist options
  • Save toopay/8276778 to your computer and use it in GitHub Desktop.
Save toopay/8276778 to your computer and use it in GitHub Desktop.
MAMP Intl
#!/bin/bash
# Install m4
cd /Applications/MAMP/bin/php/php5.4.10/include
wget ftp://ftp.gnu.org/gnu/m4/m4-1.4.10.tar.gz
tar -xvzf m4-1.4.10.tar.gz
cd m4-1.4.10
./configure --prefix=/usr/local/m4
make
sudo make install
make install
PATH=$PATH:/usr/local/m4/bin/
# Install bison
cd /Applications/MAMP/bin/php/php5.4.10/include
wget http://ftp.gnu.org/gnu/bison/bison-2.3.tar.gz
tar -xvzf bison-2.3.tar.gz
cd bison-2.3
./configure --prefix=/usr/local/bison --with-libiconv-prefix=/usr/local/libiconv/
make
sudo make install
make install
# Install ICU lib
cd /Applications/MAMP/bin/php/php5.4.10/include
wget http://download.icu-project.org/files/icu4c/51.2/icu4c-51_2-src.tgz
tar xzvf icu4c-51_2-src.tgz
cd icu/source
chmod +x runConfigureICU configure install-sh
./runConfigureICU MacOSX
make
sudo make install
# git clone http://git.php.net/repository/php-src.git php
cd /Applications/MAMP/bin/php/php5.4.10/include/php
git checkout php-5.4.10
./buildconf --force
./configure
# install so
mkdir /tmp/intl && cd /tmp/intl
wget http://pecl.php.net/get/intl-3.0.0.tgz
tar xvfz intl-3.0.0.tgz && cd intl-3.0.0
/Applications/MAMP/bin/php/php5.4.10/bin/phpize
MACOSX_DEPLOYMENT_TARGET=10.8 CFLAGS='-O3 -fno-common -arch i386 -arch x86_64' LDFLAGS='-O3 -arch i386 -arch x86_64' CXXFLAGS='-O3 -fno-common -arch i386 -arch x86_64' ./configure --with-php-config=/Applications/MAMP/bin/php/php5.4.10/bin/php-config
make
# copy the so file
cp modules/intl.so /Applications/MAMP/bin/php/php5.4.10/lib/php/extensions/no-debug-non-zts-20100525/intl.so
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment