|  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
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: potsofdirt at yahoo dot com
New email:
PHP Version: OS:


 [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-2024 The PHP Group
All rights reserved.
Last updated: Sun Jul 21 23:01:29 2024 UTC