How to re-compile with SSL enabled for MAMP Pro (Mac), macOS Sierra

Read Time:1 Minute, 23 Second


Steps for re-compiling


1. Download imap source

$ cd ~/Downloads
$ wget -c
$ rm -rf imap-2007f
$ tar xvvfz imap-2007f.tar.gz
$ cd imap-2007f
$ nano Makefile

2. Find the text osx: and replace SSLINCLUDE=/usr/include/openssl to SSLINCLUDE=/usr/local/opt/openssl/include/openssl

osx:    osxok an
        $(TOUCH) ip6
        SPECIALS="SSLINCLUDE=/usr/local/opt/openssl/include/openssl SSLLIB=/usr/lib SSLCERTS=/System/Library/OpenSSL/certs SSLKEYS=/System/Library/OpenSSL/private GSSINCLUDE=/usr/include GSSLIB=/usr/lib"

3. Compile c-client.a and copy to /usr/local/imap

$ 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

4. Go to php imap extension folder and compile

$ cd /Applications/MAMP/bin/php/php5.6.10/include/php/ext/imap/
$ /Applications/MAMP/bin/php/php5.6.10/bin/phpize
$ ./configure --with-imap=/usr/local/imap-2007f --with-kerberos --with-imap-ssl --with-php-config=/Applications/MAMP/bin/php/php5.6.10/bin/php-config
$ cp modules/ /Applications/MAMP/bin/php/php5.6.10/lib/php/extensions/no-debug-non-zts-20131226

5. Edit php.ini


Same steps for 7.0.8




Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.