/usr/bin/ld: cannot find -lltdl on PHP Make: How to Fix

By | April 21, 2010

You can meet this error while trying to make PHP on a fresh server. For example, you have this configure line:

./configure '--with-apxs2=/usr/local/apache2/bin/apxs' '--enable-calendar' '--enable-mbstring' '--disable-cgi' '--disable-magic-quotes' '--with-curl' '--with-curlwrappers' '--with-zlib' '--with-bz2' '--enable-ftp' '--with-gd' '--with-mcrypt' '--with-mhash' '--with-mysql=/usr/lib/mysql' '--enable-soap' '--with-xmlrpc' '--enable-zip' '--with-pear'

and the error you receive is:

/usr/bin/ld: cannot find -lltdl
collect2: ld returned 1 exit status
make: *** [libphp5.la] Error 1

Most probably you don’t have libtool-ltdl-devel installed. All you need is to install it using yum (or any other applicable package manager).

yum install libtool-ltdl-devel

Then run ./configure, make and make install. This should do the job.