Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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:

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.


share|improve this question
up vote 4 down vote accepted

Ok, after looking through the configure file and some other stuff I figured out what the issue was.

I was having issues with IMAP, LDAP, and XPM i.e. the configure script couldn't find some of the files it needed to complete the process. It appears some of the required files are in /usr/lib/ and some are in /usr/lib/x86_64-linux-gnu, with most in the former.

However, you could set --with-libdir in your configure script to deal with one issue, and that setting breaks for something else #Bummer. In my case, I set this to default to /usr/lib/x86_64-linux-gnu, but there were a lot of files in /usr/lib e.g. libc-client.a as listed in my question.

So I decided to set up the configure options for /usr/lib as default and then create symlinks for the errant files in x86_64-linux-gnu.

So basically, here's what I did:

A. Create symlinks for the errant files

ln -s /usr/lib/x86_64-linux-gnu/libXpm.a /usr/lib/libXpm.a
ln -s /usr/lib/x86_64-linux-gnu/ /usr/lib/
ln -s /usr/lib/x86_64-linux-gnu/liblber.a /usr/lib/liblber.a
ln -s /usr/lib/x86_64-linux-gnu/libldap_r.a /usr/lib/libldap_r.a

B. Changed some specific configure options I set earlier in the question to the following (all I changed was the 3 listed here, the other options remained as they were)

--with-libdir=lib --with-xpm-dir=/usr --with-ldap=/usr

And everything worked ok after this.

I hope it helps if you run into the same issue. Cheers.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.