SunshinePHP 2019 CFP Started


Esta extensión requiere la instalación de la biblioteca c-client. Descargue la última versión desde » y compílela.

Es importante que no copie los ficheros fuente de IMAP directamente en el directorio de inclusión del sistema ya que puede haber conflictos. En su lugar, cree un nuevo directorio dentro del directorio de inclusión del sistema, tal como /usr/local/imap-2000b/ (la ubicación y el nombre depende de su configuración y versión de IMAP), y dentro de este nuevo directorio cree unos directorios adicionales llamados lib/ e include/. Desde el directorio de c-client del árbol fuente de IMAP, copie todos los ficheros *.h en include/ y todos los ficheros *.c en lib/. Además, cuando compile IMAP, se creará un fichero llamado c-client.a. Póngalo también en el directorio lib/, pero renómbrelo como libc-client.a.


Para construir la biblioteca c-client con soporte para SSL y/o Kerberos, lea los documentos proporcionados con el paquete.

Nota: En Mandrake Linux, la biblioteca IMAP (libc-client.a) es compilada sin soporte para Kerberos. Se instala una versión diferente con SSL (client-PHP4.a). La biblioteca debe ser compilada para añadir soporte para Kerberos.

add a note add a note

User Contributed Notes 7 notes

crabb1d at gmail dot com
4 years ago
For those using Ubuntu and who are completely daunted by compiling this, it's easy under Ubuntu:

Install libc-client-dev
# sudo apt-get install libc-client-dev

Install PHP5 imap:
# sudo apt-get install php5-imap

Restart Apache
# sudo service apache2 reload

Should work for most people.
eelco at care dot nl
8 years ago
Spent hours and hours on compiling PHP with IMAP support on CentOS 64-bit but after many trial and error sessions I got if fixed.

If you have set the '--with-libdir=lib64' flag and you encounter the the 'cannot find the c-client library' error while compiling, try to create a symlink 'lib64' to 'lib' in your imap installation dir.

Apparantly, PHP will search only in lib64 directories if the flag is set. This also applies on the IMAP library but documentation lacks on this point.
ldi at email dot cz
8 years ago
After few hours of testing it on CentOS 5 64 bit I'd like to share the steps required to compile imap with php:

1. Install openssl:

   yum install openssl openssl-devel

2. If you don't have openssl compiled and installed in /usr/local/ssl create symlink:

   ln -s /usr/lib64/openssl/engines/ /usr/local/ssl

3. Add the libraries:

   ln -s /usr/include/ /usr/local/ssl/include

4. Compile IMAP

  cd /path/to/imap_src
  make lnp SSLTYPE=unix

5. Copy files as described above
mkdir lib
mkdir include
cp c-client/*.c lib/
cp c-client/*.h include/
cp c-client/c-client.a lib/libc-client.a

6. Compile PHP
  cd /path/to/php/src
  ./configure --with-imap=/path/to/imap_src --with-libdir=lib64
6 years ago
When compiling IMAP on a 64 bit machine, use: make EXTRACFLAGS=-fPIC.
jameslandrok at gmail dot com
3 years ago
A more secure & easy way to do this on Debian 7.7, php 5.4:

apt-get install php5-imap

Packages installed
  libc-client2007e mlock php5-imap
5 years ago
When compiling IMAP 2007f with php 5.3.27 on a 64 bit OL5.7 machine, add in the Makefile: EXTRACFLAGS=-fPIC and EXTRAAUTHENTICATORS=gss
8 years ago
If you run into an error similar to the following when compiling / making PHP:

errno 0x21c /usr/local/imap-2007e/lib/libc-client.a(netmsg.o)
ld: fatal: relocations remain against allocatable but non-writable sections
make: Fatal error: Command failed for target `'

You need to recompile the IMAP library and add -fpic or -fPIC to your CFLAGS.


Also, if you compiled OpenSSL from source, you'll need to do the same, as you'll get error messages for libc-client.a
To Top