configure: error: Cannot find imap library (libc-client.a) – How to Fix

By | April 20, 2020

Today I had to add IMAP support to PHP 5.6, built from sources.

When I tried to add it, here’s the error I received:

configure: error: Cannot find imap library (libc-client.a). Please check your c-client installation.

Just a quick solution today:

Install autoconf, if you don’t have it yet:

yum install autoconf
cd ./php-5.6.40/ext/imap/
./configure --with-imap-ssl --with-libdir=lib64 --with-kerberos 
make install

Now it’s time to configure PHP – add this to your configure line:

--with-libdir=lib64 --with-kerberos --with-imap-ssl --with-imap

Verify it’s installed:

php -i | grep imap

You should see something like this:

[root@server php-5.6.40]# php -i | grep imap
Configure Command =>  './configure'  '--with-apxs2' '--with-curl' '--enable-pcntl' '--with-mysql' '--with-pdo-mysql' '--with-mysqli' '--with-openssl' '--enable-ftp' '--with-zlib' '--enable-zip' '--enable-sockets' '--enable-mbstring' '--with-mcrypt' '--with-mhash' '--enable-bcmath' '--with-gmp' '--enable-soap' '--with-libdir=lib64' '--with-kerberos' '--with-imap-ssl' '--with-imap'
Protocols => dict, file, ftp, ftps, gopher, http, https, imap, imaps, ldap, ldaps, pop3, pop3s, rtsp, scp, sftp, smtp, smtps, telnet, tftp
imap.enable_insecure_rsh => Off => Off

Leave a Reply

Your email address will not be published.