brew, brew mac

How to install PHP-IMAP extension in Mac

I’ve finally found the solution. Most of it was here:

My machine is a late 2011 Macbook Pro with MacOSX 10.7.4, PHP 5.4. installed via these instructions:

Here’s a step-by-step for those with a similar or identical setup:

Download the imap source from this url, focus on the one with the most recent date which doesn’t end in “Z”:

Unarchive, go into folder, run the following commands:

$ make osx EXTRACFLAGS="-arch i386 -arch x86_64 -g -Os -pipe -no-cpp-precomp"

The above command will throw a bunch of warnings at you, but should complete sucessfully, unlike the command originally suggested in the september28 blog post.

Next, do the following:

$ sudo cp c-client/*.h /usr/local/include/
$ sudo cp c-client/*.c /usr/local/lib/
$ sudo cp c-client/c-client.a /usr/local/lib/libc-client.a

Once this is done, go into the downloaded php source folder if you made a custom upgrade like I did (as per the second link in the answer) and build the extension for your system. If you didn’t build a custom version, just download the PHP source for the version you have installed, and use that, it doesn’t matter.

$ cd ~/Downloads/Php-5.4.4/ext/imap
$ phpize
$ ./configure --with-imap==/usr/local/imap-2007 --with-kerberos --with-imap-ssl
$ make

Once done, do the following:

$ sudo cp modules/ /usr/lib/php/extensions/no-debug-non-zts-20100525/

…or if your PHP extension folder is different, put that (you can see the location in phpinfo(); )

Restart apache and you should be ready to go.

$ sudo apachectl restart

1 comentario en “How to install PHP-IMAP extension in Mac”


Introduce tus datos o haz clic en un icono para iniciar sesión:

Logo de

Estás comentando usando tu cuenta de Cerrar sesión /  Cambiar )

Google photo

Estás comentando usando tu cuenta de Google. Cerrar sesión /  Cambiar )

Imagen de Twitter

Estás comentando usando tu cuenta de Twitter. Cerrar sesión /  Cambiar )

Foto de Facebook

Estás comentando usando tu cuenta de Facebook. Cerrar sesión /  Cambiar )

Conectando a %s

Este sitio usa Akismet para reducir el spam. Aprende cómo se procesan los datos de tus comentarios .