php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #67110 static compile failed,
Submitted: 2014-04-22 16:20 UTC Modified: 2014-07-10 14:49 UTC
From: paulgao at yeah dot net Assigned: mike (profile)
Status: No Feedback Package: pecl_http (PECL)
PHP Version: 5.5.11 OS: CENTOS
Private report: No CVE-ID: None
 [2014-04-22 16:20 UTC] paulgao at yeah dot net
Description:
------------
When i try static compile, display:
--
/usr/bin/ld: cannot find -lSSL
collect2: ld returned 1 exit status
make: *** [sapi/cli/php] Error 1
make: *** Waiting for unfinished jobs....
/usr/bin/ld: cannot find -lSSL
collect2: ld returned 1 exit status
make: *** [sapi/fpm/php-fpm] Error 1
--

OS: Centos 6.5 x64

[root]# curl-config --features
SSL
IPv6
libz
IDN
NTLM

plz check & fix it...

Test script:
---------------
command:
./configure --prefix=/usr/local/php --without-pear --with-mysqli=mysqlnd --disable-phar --with-iconv --with-zlib --enable-exif --enable-sockets --enable-mbstring=all --enable-inline-optimization --disable-debug --enable-static --disable-ipv6 --enable-bcmath --enable-zip --with-bz2 --with-curl --with-openssl --enable-memcached --disable-memcached-session --with-libmemcached-dir=/usr/local/libmemcached --enable-memcached-igbinary --enable-apc --enable-apc-spinlocks --enable-igbinary --enable-fpm --enable-mongo --enable-raphf --enable-propro --with-http --enable-xhprof --enable-redis --enable-redis-igbinary


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2014-04-23 04:24 UTC] mike@php.net
-Assigned To: +Assigned To: mike
 [2014-04-23 12:08 UTC] mike@php.net
-Status: Assigned +Status: Feedback
 [2014-04-23 12:08 UTC] mike@php.net
Ok, this is odd. "SSL" should be replaced with "crypto" or "gcrypt", depending on the SSL/ctypro lib linked with libcurl.

Which CentOS version are you on? Which versions of libcurl/libopenssl/gnutls? Is libcurl linked with openssl or gnutls?

Thanks.
 [2014-04-23 12:52 UTC] paulgao at yeah dot net
Which CentOS version are you on?

Centos 6.5 X64

Which versions of libcurl/libopenssl/gnutls?
Is libcurl linked with openssl or gnutls?

use configure command display:

checking for zlib.h... found in /usr
checking for zlib version >= 1.2.0.4... 1.2.3
checking for curl/curl.h... found in /usr
checking for curl-config... found: /usr/bin/curl-config
checking for curl version >= 7.18.2... 7.19.7
checking for SSL support in libcurl... yes
checking for openssl support in libcurl... no
checking for gnutls support in libcurl... no
checking for bundled SSL CA info... /etc/pki/tls/certs/ca-bundle.crt
checking for event2/event.h... found in /usr
checking for libevent version, roughly... "2.0.21-stable"
checking for ext/raphf support... yes
checking for php_raphf.h... /root/php-5.5.11/ext/raphf
checking for ext/propro support... yes
checking for php_propro.h... /root/php-5.5.11/ext/propro
checking whether to depend on extensions which have been built shared... yes

[root@centos ~]# yum install gnutls*
Loaded plugins: fastestmirror, presto
Loading mirror speeds from cached hostfile
Setting up Install Process
Package gnutls-2.8.5-13.el6_5.x86_64 already installed and latest version
Package gnutls-utils-2.8.5-13.el6_5.x86_64 already installed and latest version
Package gnutls-guile-2.8.5-13.el6_5.x86_64 already installed and latest version
Package gnutls-devel-2.8.5-13.el6_5.x86_64 already installed and latest version
Nothing to do

[root@centos ~]# yum install openssl*
Loaded plugins: fastestmirror, presto
Loading mirror speeds from cached hostfile
Setting up Install Process
Package openssl-perl-1.0.1e-16.el6_5.7.x86_64 already installed and latest version
Package openssl-static-1.0.1e-16.el6_5.7.x86_64 already installed and latest version
Package openssl-1.0.1e-16.el6_5.7.x86_64 already installed and latest version
Package openssl-devel-1.0.1e-16.el6_5.7.x86_64 already installed and latest version
Package openssl098e-0.9.8e-17.el6.centos.2.x86_64 already installed and latest version
Nothing to do

enough?
 [2014-05-05 18:06 UTC] paulgao at yeah dot net
WHAT ABOUT???
 [2014-05-14 07:03 UTC] mike@php.net
Sorry for the delay!

How about:

# curl-config --features
# curl-config --static-libs
# ldd $(curl-config --prefix)/lib/libcurl.so

Is there some curl-gnutls or curl-openssl package to install?
 [2014-05-14 07:04 UTC] mike@php.net
Please don't forget to **re-open** the bug when you answer.

Thank you!
 [2014-05-14 07:34 UTC] paulgao at yeah dot net
-Status: Feedback +Status: Assigned
 [2014-05-14 07:34 UTC] paulgao at yeah dot net
[root@centos tmp]# curl-config --features
SSL
IPv6
libz
IDN
NTLM

[root@centos tmp]# curl-config --static-libs
unknown option: --static-libs
Usage: curl-config [OPTION]

[root@centos tmp]# ldd $(curl-config --prefix)/lib/libcurl.so
ldd: /usr/lib/libcurl.so: No such file or directory

[root@centos usr]# ldd /usr/lib64/libcurl.so
        linux-vdso.so.1 =>  (0x00007fff747f7000)
        libidn.so.11 => /lib64/libidn.so.11 (0x00007ff37047d000)
        libldap-2.4.so.2 => /lib64/libldap-2.4.so.2 (0x00007ff370230000)
        librt.so.1 => /lib64/librt.so.1 (0x00007ff370027000)
        libgssapi_krb5.so.2 => /lib64/libgssapi_krb5.so.2 (0x00007ff36fde3000)
        libkrb5.so.3 => /lib64/libkrb5.so.3 (0x00007ff36fafd000)
        libk5crypto.so.3 => /lib64/libk5crypto.so.3 (0x00007ff36f8d0000)
        libcom_err.so.2 => /lib64/libcom_err.so.2 (0x00007ff36f6cc000)
        libz.so.1 => /lib64/libz.so.1 (0x00007ff36f4b6000)
        libssl3.so => /usr/lib64/libssl3.so (0x00007ff36f277000)
        libsmime3.so => /usr/lib64/libsmime3.so (0x00007ff36f04b000)
        libnss3.so => /usr/lib64/libnss3.so (0x00007ff36ed0d000)
        libnssutil3.so => /usr/lib64/libnssutil3.so (0x00007ff36eae0000)
        libplds4.so => /lib64/libplds4.so (0x00007ff36e8dc000)
        libplc4.so => /lib64/libplc4.so (0x00007ff36e6d7000)
        libnspr4.so => /lib64/libnspr4.so (0x00007ff36e499000)
        libpthread.so.0 => /lib64/libpthread.so.0 (0x00007ff36e27c000)
        libdl.so.2 => /lib64/libdl.so.2 (0x00007ff36e078000)
        libssh2.so.1 => /usr/lib64/libssh2.so.1 (0x00007ff36de4f000)
        libc.so.6 => /lib64/libc.so.6 (0x00007ff36dabb000)
        liblber-2.4.so.2 => /lib64/liblber-2.4.so.2 (0x00007ff36d8ac000)
        libresolv.so.2 => /lib64/libresolv.so.2 (0x00007ff36d691000)
        libsasl2.so.2 => /usr/lib64/libsasl2.so.2 (0x00007ff36d477000)
        /lib64/ld-linux-x86-64.so.2 (0x00007ff370914000)
        libkrb5support.so.0 => /lib64/libkrb5support.so.0 (0x00007ff36d26c000)
        libkeyutils.so.1 => /lib64/libkeyutils.so.1 (0x00007ff36d068000)
        libssl.so.10 => /usr/lib64/libssl.so.10 (0x00007ff36cdfc000)
        libcrypto.so.10 => /usr/lib64/libcrypto.so.10 (0x00007ff36ca1b000)
        libcrypt.so.1 => /lib64/libcrypt.so.1 (0x00007ff36c7e4000)
        libselinux.so.1 => /lib64/libselinux.so.1 (0x00007ff36c5c5000)
        libfreebl3.so => /lib64/libfreebl3.so (0x00007ff36c34d000)
 [2014-05-15 11:29 UTC] mike@php.net
-Status: Assigned +Status: Feedback
 [2014-05-15 11:29 UTC] mike@php.net
I'm sorry to ask that, but could you compile & run the following program, like:

$ cat >/tmp/curlv.c <<'EOF
#include <curl/curl.h>
int main(int argc, char *argv[]) {
	curl_version_info_data *data = curl_version_info(CURLVERSION_NOW);
	if (data && data->ssl_version && *data->ssl_version) {
		printf("%s\n", data->ssl_version);
		return 0;
	}
	return 1;
}
EOF

$ gcc -o /tmp/curlv -lcurl /tmp/curlv.c

It should print "OpenSSL/1.0.1e"
 [2014-05-19 10:13 UTC] paulgao at yeah dot net
[root@bogon ~]# gcc -o /tmp/curlv -lcurl /root/tmp.c
[root@bogon ~]# /tmp/curlv 
NSS/3.14.0.0
 [2014-05-19 11:29 UTC] mike@php.net
-Status: Feedback +Status: Assigned
 [2014-05-19 11:29 UTC] mike@php.net
Jeez!
 [2014-05-19 13:12 UTC] mike@php.net
-Status: Assigned +Status: Feedback
 [2014-05-19 13:12 UTC] mike@php.net
Could you please try the following patch:

------------------8<--------------------
diff --git a/config9.m4 b/config9.m4
index ce63132..24d0fd0 100644
--- a/config9.m4
+++ b/config9.m4
@@ -273,9 +273,12 @@ dnl ----
                        PHP_ADD_INCLUDE($CURL_DIR/include)
                        PHP_ADD_LIBRARY_WITH_PATH(curl, $CURL_DIR/$PHP_LIBDIR, HTTP_SHARED_LIBADD)
                        PHP_EVAL_LIBLINE(`$CURL_CONFIG --libs`, HTTP_SHARED_LIBADD)
-                       if test "x$CURL_SSL" != "x"; then
+                       case "$CURL_SSL"
+                       in
+                       crypto|gcrypt)
                                PHP_ADD_LIBRARY_WITH_PATH([$CURL_SSL], $CURL_DIR/$PHP_LIBDIR, PHP_HTTP_SHARED_LIBADD)
-                       fi
+                               ;;
+                       esac
                        AC_DEFINE([PHP_HTTP_HAVE_CURL], [1], [Have libcurl support])
                        HTTP_HAVE_A_REQUEST_LIB=true
                fi
------------------>8--------------------
 [2014-05-19 13:14 UTC] mike@php.net
Oh, line breaks -- try this instead: http://pastebin.com/G4aZShqS
 [2014-07-10 14:49 UTC] mike@php.net
-Status: Feedback +Status: No Feedback
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 21 13:01:31 2024 UTC