I'm trying to install PHP 5.3.21 on a Rackspace Cloud Server running Ubuntu 12.04 but I keep running into errors during configure. It keeps giving me the following error:

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

Here is my PHP configuration script:

./configure --enable-fpm --enable-cli --with-fpm-user=phpfpm --with-fpm-group=phpfpm --prefix=/usr/local/php --exec-prefix=/usr/local/php --with-config-file-path=/usr/local/php/etc --with-config-file-scan-dir=/usr/local/php/etc/conf.d --with-libdir=/lib/x86_64-linux-gnu --enable-bcmath --enable-ctype --with-curl --with-curlwrappers --with-pear --enable-dba --with-cdb --enable-exif --enable-ftp --disable-fileinfo --with-gd --with-jpeg-dir --with-png-dir --with-zlib-dir --with-xpm-dir --with-freetype-dir --with-t1lib --enable-gd-native-ttf --with-gettext --with-gmp --with-imap=/usr/local/c-client-2007f --with-imap-ssl --with-ldap --with-ldap-sasl --enable-mbstring=all --with-mcrypt --with-mhash --with-mysql --with-mysqli --with-pdo-mysql --enable-sqlite-utf8 --with-openssl --with-kerberos --with-pspell --enable-shmop --enable-simplexml --with-snmp --enable-soap --enable-sockets --with-tidy --enable-wddx --enable-xmlreader --with-xmlrpc --with-xsl --enable-zip --with-zlib --enable-sysvsem --enable-sysvshm

And here are the packages I installed prior:

apt-get -y install php5-dev php-pear php5-imap
apt-get -y install libxml2-dev libevent-dev zlib1g-dev libbz2-dev libgmp3-dev libssl-dev libcurl4-openssl-dev libjpeg-dev libpng-dev libxpm-dev libgd2-xpm-dev libmcrypt-dev memcached libmemcached-dev libpcre3-dev libc-client-dev libkrb5-dev libsasl2-dev libmysqlclient-dev libpspell-dev libsnmp-dev libtidy-dev libxslt-dev libtool libc-client2007e libc-client2007e-dev
apt-get -y build-dep t1lib
printf "\n" | apt-get -y install t1lib-bin libt1-dev

I have also tried installing the C-Client IMAP from source using the following:

wget ftp://ftp.cac.washington.edu/imap/c-client.tar.Z
tar -xvf c-client.tar.Z
cd imap-2007f
make clean
cp c-client/c-client.a c-client/libc-client.a
mkdir -p /usr/local/c-client-2007f/lib
mkdir -p /usr/local/c-client-2007f/include
cp c-client/*.h /usr/local/c-client-2007f/include
cp c-client/*.a /usr/local/c-client-2007f/lib
cd ..

but I still get the error.

I'd appreciate any assistance to enable me resolve this.


4 Answers 4


Try running sudo apt-get install build-essential. This should install any missing lib you need to build.

  • I just tried and it says build-essential is already newest version
    – ObiHill
    Feb 19, 2013 at 21:21
  • This didn't work for me.
    – kiltek
    Mar 13, 2017 at 9:52

I managed to sort this out.

I posted my answer here: https://askubuntu.com/questions/258394/error-installing-php-5-3-21-on-ubuntu-12-04



I was having this problem and eventually stumbled upon a site which gave me the solution:

ln -s /usr/lib/libc-client.a /usr/lib/x86_64-linux-gnu/libc-client.a
  • That was great!, worked for me Sep 17, 2019 at 7:46
$ apt-file search libc-client.a
libc-client2007e-dev: /usr/lib/libc-client.a

So you should install libc-client2007e-dev (or similar) and apt-file too to be able to search yourself next time =)

$ apt-cache show apt-file
Description: search for files within Debian packages (command-line interface)
 apt-file is a command line tool for searching files contained in packages
 for the APT packaging system. You can search in which package a file is
 included or list the contents of a package without installing or fetching it.

So finally :

sudo apt-get install libc-client2007e-dev apt-file

But have you checked that you can't install php by apt-get too ?

Try :

apt-cache policy php5

to see different versions available in your system (you can add some repository)

  • libc-client2007e-dev is already one of the packages I said I already installed. And I'm installing from source because I need to test different versions of PHP.
    – ObiHill
    Feb 19, 2013 at 21:24

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .