Monday 27 February 2012

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

This culprit emits error to indicates your build ./configure options require additional library file to be installed before PHP can proceed successfully with the build process. The solution described here assumes you're building the sources to install or re-installing PHP manually. Your ./configure option either looks or have options similar to the one shown below:
./configure --enable-embed --enable-maintainer-zts --disable-short-tags --enable-pcntl --with-tsrm-pthreads --with-mysqli --with-mysql --with-
pdo-mysql --with-zlib --enable-sysvmsg --enable-sysvsem --enable-sysvshm --enable-bcmath --enable-calendar --enable-exif --enable-ftp --with-gd 
--enable-gd-native-ttf --enable-gd-jis-conv --with-iconv-dir --with-gettext --with-imap --with-imap-ssl --with-ldap --with-ldap-sasl --enable-
mbstring --with-mcrypt --with-mhash --enable-soap --enable-sockets --enable-wddx --with-xmlrpc --with-xsl --enable-zip --with-kerberos --with-tidy 
--with-curl --with-curlwrappers

SOLUTION.
First lets take a look at the error again.
/usr/bin/ld: cannot find -lltdl 
collect2: ld returned 1 exit status make: *** [libphp5.la] Error 1
The portion we are interested is cannot find -lltdl, this tells us the header file libltdl.so cannot be found. To resolve this:
  • Install the header file via
    apt-get install libtool
  • If you're configuring for MySQL, install libdbd-mysql
    apt-get install libdbd-mysql
  • Run
    make clean
    ./configure -- with your additonal configure options
    make
    make install
    
If you do have any other error related to your additional configure options, see here for resolutions. Good luck.

No comments:

Post a Comment