Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

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 compile PHP 5.3.21 on Ubuntu 11.04. I keep getting the following error:

configure: error: libXpm.(a|so) not found.

I searched for the location for libXpm.a and and both of them are in /usr/lib. So I then update --with-xpm-dir to --with-xpm-dir=/usr/lib in my configure script, but I still get the same error. I've also installed libxpm-dev and a host of other dependent libraries, but still I get the error.

Below is the entire configure 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 --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=/usr/lib --with-freetype-dir --with-t1lib --enable-gd-native-ttf --with-gettext --with-gmp --with-imap --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

I'd really appreciate some assistance.


share|improve this question
up vote 1 down vote accepted

I was able to solve this by changing the settings of the specific configure options below:

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

This ensured that /usr/lib would one of the main locations that would be searched for required files.

It worked ok after this.

share|improve this answer
it worked on CentOS 6.2 as well – user176967 Jun 7 '13 at 11:31
this doesn't always work, many times you need to symlink, more here: – Eva Jan 7 '14 at 9:59

i solved this by:

ln -s /usr/lib/x86_64-linux-gnu/ /usr/lib/
ln -s /usr/lib/x86_64-linux-gnu/libXpm.a /usr/lib/
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.