php imap build on mac

2014年12月15日

#!/bin/bash
BUILDDIR=/usr/local/src/

# 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/

Comments are closed.