Monday, February 21, 2022

[SOLVED] CentOS 7 "Cannot find imap library (libc-client.a)" when compiling PHP 7

Issue

I'm compiling PHP7 on CentOS 7. I have added the EPEL repository and installed uw-imap-devel which adds "libc-client.so" to \usr\lib64. When I run my configure command with imap support:

./configure --with-apxs2=/usr/bin/apxs --with-mysqli --with-imap --with-imap-ssl --with-kerberos --with-pdo-mysql --with-openssl --with-curl --enable-pcntl --libdir=/usr/lib64 --with-zlib --enable-zip --enable-mbstring --enable-intl --with-readline --with-xsl --with-gd --with-jpeg-dir=/usr/lib64 --with-png-dir=/usr/lib64 --with-gmp --enable-bcmath --enable-opcache --with-config-file-path=/etc --with-config-file-scan-dir=/etc/php.d

I get:

"...

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

"


Solution

An earlier error message (because of a typo) led me down a rabbit hole and I changed --with-libdir=lib64 to libdir=\usr\lib64, which somehow triggered this current error. By fixing my original typo (a missing "--") and reverting to with-libdir=lib64, everything worked as expected.



Answered By - Thelonias
Answer Checked By - Mildred Charles (WPSolving Admin)