|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #57216 -ldl flag prevents extension from compiling
Submitted: 2006-09-01 16:32 UTC Modified: 2009-01-11 13:51 UTC
From: potsofdirt at yahoo dot com Assigned:
Status: Closed Package: ssh2 (PECL)
PHP Version: 5.1.6 OS: FreeBSD 6.0
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem:
42 - 30 = ?
Subscribe to this entry?

 [2006-09-01 16:32 UTC] potsofdirt at yahoo dot com

When I try to install via PEAR, or if I try to compile it into php as a static extension I get an error about not having libssh2 0.4 or above even though libssh2 0.14 is installed. 

Per recommendation of I removed the -ldl flag from the config.m4 file in the extension and it compiled fine through pear. To compile it as a static extension into php I had to remove the same flag from configure. I am not familiar enough with how configure is built to know why it was not removed even after I performed `rm configure` and `./buildconf --force`.

After removal of this flag, everything seems to work fine.

Reproduce code:
./configure --with-apxs2=/usr/local/apache/bin/apxs \
--with-mysql=/usr/local/mysql \
--with-pgsql=/usr/local/pgsql \
--enable-calendar \
--enable-trans-sid \
--with-curl=/usr/local \
--with-sybase=/usr/local/freetds \
--enable-ftp \
--with-mcrypt \
--with-pspell \
--with-xdiff \
--with-zlib \
--with-openssl \
--enable-soap \

Expected result:
Php should have configured correctly

Actual result:
checking for libssh2_banner_set in -lssh2... no
configure: error: libssh2 version >= 0.4 not found


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2006-09-21 09:14 UTC] potsofdirt at yahoo dot com
I created the following patch for config.m4 that should solve compilation issues on systems without libdl:

--- old/config.m4	Thu Sep 21 08:55:10 2006
+++ new/config.m4	Thu Sep 21 08:56:13 2006
@@ -29,6 +29,11 @@
+  EXTRA_LIBS="-lm"
+  AC_CHECK_LIB(dl, dlopen, [
+  ])
@@ -36,7 +41,7 @@
     AC_MSG_ERROR([libssh2 version >= 0.4 not found])
-    -L$SSH2_DIR/lib -lm -ldl
+    -L$SSH2_DIR/lib $EXTRA_LIBS
 [2009-01-11 13:51 UTC]
Thank you for your bug report. This issue has been fixed
in the latest released version of the package, which you can download at

This was actually already fixed in CVS when you reported it -- looks like the libdl dependency wasn't needed at all.
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Wed Oct 04 10:01:25 2023 UTC