Skip to content

Instantly share code, notes, and snippets.

@liuyu121
Last active August 29, 2015 14:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save liuyu121/5f9990851dd046be9840 to your computer and use it in GitHub Desktop.
Save liuyu121/5f9990851dd046be9840 to your computer and use it in GitHub Desktop.
#!/bin/bash
BUILDDIR=/tmp/phpimapmountainlion
# Original Script found at:
# http://blog.vucica.net/2012/10/installing-imap-extension-for-php-on-mountain-lion.html
mkdir "$BUILDDIR"
echo " "
echo "= FETCHING AND INSTALLING IMAP"
echo " "
cd "$BUILDDIR"
wget -c ftp://ftp.cac.washington.edu/imap/imap-2007f.tar.gz
rm -rf imap-2007f
tar xvvfz imap-2007f.tar.gz
cd imap-2007f
make osx EXTRACFLAGS="-arch i386 -arch x86_64 -g -Os -pipe -no-cpp-precomp"
sudo mkdir -p /usr/local/imap-2007f/include
sudo cp c-client/*.h /usr/local/imap-2007f/include
sudo mkdir -p /usr/local/imap-2007f/lib
sudo cp c-client/c-client.a /usr/local/imap-2007f/lib/libc-client.a
echo " "
echo "= FETCHING AND INSTALLING PCRE"
echo " "
cd "$BUILDDIR"
wget "http://sourceforge.net/projects/pcre/files/pcre/8.33/pcre-8.33.tar.gz"
rm -rf pcre-8.33
tar xvvfz pcre-8.33.tar.gz
cd pcre-8.33
./configure --prefix=/usr/local
make
sudo make install
echo " "
echo "= FETCHING AND INSTALLING PHP-IMAP"
echo " "
cd "$BUILDDIR"
PHPVERSION=`php --version|head -n1|cut -f 2 -d ' '`
##git clone -b "PHP-$PHPVERSION" https://github.com/php/php-src.git php-src
wget --no-check-certificate -c https://github.com/php/php-src/tarball/PHP-5.3.26 -O PHP-5.3.26.tar.gz
tar xvvfz PHP-5.3.26.tar.gz
cd `ls |grep php-php-src-|head -n1`
cd ext/imap
phpize
./configure --with-imap=/usr/local/imap-2007f --with-kerberos --with-imap-ssl
make
sudo cp modules/imap.so /usr/lib/php/extensions/no-debug-non-zts-20090626/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment