curl: (2) Failed initialization

TomR

Verified User
Joined
Jan 7, 2008
Messages
51
CentOS 6.7
CustomBuild 2.0

Code:
/usr/local/bin/curl -V
curl 7.44.0 (x86_64-unknown-linux-gnu) libcurl/7.19.7 NSS/3.19.1 Basic ECC zlib/1.2.3 libidn/1.18 libssh2/1.4.2
Protocols: tftp ftp telnet dict ldap ldaps http file https ftps scp sftp
Features: IDN IPv6 Largefile NTLM SSL libz


Code:
/usr/bin/curl 
curl 7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 NSS/3.19.1 Basic ECC zlib/1.2.3 libidn/1.18 libssh2/1.4.2
Protocols: tftp ftp telnet dict ldap ldaps http file https ftps scp sftp
Features: GSS-Negotiate IDN IPv6 Largefile NTLM SSL libz

Worked fine on CentOS5

Code:
/usr/local/bin/curl -L --url https://[domain].[tld]/plugin.php?page=Source/import\&id=60\&api_key=***

However on CentOS6 this results in:
Code:
curl: (2) Failed initialization
:confused:
Also did a but with no success
Code:
./build curl
./build php
 
Last edited:
I found a difference with a server where curl is working

Code:
#curl -V
curl 7.44.0 (x86_64-unknown-linux-gnu) libcurl/7.44.0 OpenSSL/1.0.1j zlib/1.2.3 libidn/1.18
Protocols: dict file ftp ftps gopher http https imap imaps pop3 pop3s rtsp smb smbs smtp smtps telnet tftp
Features: IDN IPv6 Largefile NTLM NTLM_WB SSL libz TLS-SRP UnixSockets

Not working
Code:
#curl -V
curl 7.44.0 (x86_64-unknown-linux-gnu) libcurl/7.19.7 NSS/3.19.1 Basic ECC zlib/                                                                                                                                                             1.2.3 libidn/1.18 libssh2/1.4.2
Protocols: tftp ftp telnet dict ldap ldaps http file https ftps scp sftp
Features: IDN IPv6 Largefile NTLM SSL libz

Both servers CentOS6 and CustomBuild 2.0

Were does the difference come from?
 
Hmmz... there is a lot of differences to see, one of the first is OpenSSL which is not present. As are some other things.
But I don't know if that is of any influence on correct working of curl.

Since you also have 2 curl versions (like I do), you might consider to remove one (yum remove curl) or to update it (yum update curl).

Or why don't you upgrade Centos 6 to Centos 6.7 if it's working on 6.7?
 
Servers are all CentOS 6.7

Problem is that they are all standard DirectAdmin installs. However the lastest two installed servers both suffers the same problem with cURL.
All servers have openSSL, I can see the version.

Is it possible to reinstall cURL, because updating from CustomBuild is not working.

By the way, all servers have two cURL versions:
/usr/bin
usr/local/bin

That seems standard after DA install

Please some advice as I hesitate to reinstall two servers. They are in production yet!
 
The fact that all servers have to cURL versions is because cURL is also installed via yum and/or with a Centos base installation.
The second one (/usr/local/bin) is from custombuild install.

I've got one of our servers running without any problems with only the Centos version. In options.conf it says curl=no and /usr/local/bin/curl is not present.
Code:
[root@server19: /usr/local/directadmin/custombuild]# curl -V
curl 7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 NSS/3.19.1 Basic ECC zlib/1.2.3 libidn/1.18 libssh2/1.4.2
Protocols: tftp ftp telnet dict ldap ldaps http file https ftps scp sftp 
Features: GSS-Negotiate IDN IPv6 Largefile NTLM SSL libz
Strange this version 7.19 because I'm running this on a Centos 6.7 server too. The other ones also have version 7.44.

However, maybe your problem has some other cause or missing module. Maybe Sellerone or Zeiter have any idea's about it?
 
Last edited:
im having the same issue too
curl 7.45.0 (x86_64-pc-linux-gnu) libcurl/7.19.7 NSS/3.19.1 Basic ECC zlib/1.2.3 libidn/1.18 libssh2/1.4.2
Protocols: tftp ftp telnet dict ldap ldaps http file https ftps scp sftp
Features: IDN IPv6 Largefile NTLM SSL libz

please fix this. -v wont work
 
I think it's due to 2 different libcurl instances on the box.
Curl is 7.45.0, so it should be using that library, but it's using 7.19.7, so that doesn't match up.

Check to see which "curl" you're using, and which libraries it's using
Code:
which curl
ldd `which curl` | grep libcurl
John
 
[root@server ~]# which curl
/usr/local/bin/curl
[root@server ~]# ldd `which curl` | grep libcurl
libcurl.so.4 => /usr/lib64/libcurl.so.4 (0x00007fb47c7bd000)
 
OK, so that means there are the rpm packages:
curl
curl-devel

installed.... which are fighting with the CB installed version.

The simplest is to pick one or the other, and remove the one you don't need.
The CB2 version would typically be more up to date vs the rpms, but the rpms are often handy if they need to satisfy a requirement for some other rpm.

Our test box has this:
Code:
[root@es6-64 ~]# ll /usr/lib64/libcurl.so.4
lrwxrwxrwx. 1 root root 16 Nov  6  2014 /usr/lib64/libcurl.so.4 -> libcurl.so.4.1.1
[root@es6-64 ~]# ll /usr/local/lib/libcurl.so.4
lrwxrwxrwx 1 root root 16 Oct 20 01:21 /usr/local/lib/libcurl.so.4 -> libcurl.so.4.4.0
where 4.4.0 is newer than 4.1.1, I'm guessing which is why we're not affected by it.

Check which library your 2 libcurl.so.4 files point to.

Note: After making any changes to a library, use "ldconfig" to tell the link to check everything again for the newest version of things.

John
 
I am able to usr the new curl version, however custombuild is using the wrong openSSL version, despite the fact that I updated it earlier.
Code:
[root@ custombuild]# /usr/local/bin/curl -V
curl 7.48.0 (x86_64-pc-linux-gnu) libcurl/7.48.0 OpenSSL/1.0.1e zlib/1.2.7
Protocols: dict file ftp ftps gopher http https imap imaps pop3 pop3s rtsp smb smbs smtp smtps telnet tftp
Features: IPv6 Largefile NTLM NTLM_WB SSL libz UnixSockets
[root@ custombuild]# openssl version
OpenSSL 1.0.2g  1 Mar 2016
Any idea how to get curl use the latest version of openSSL?
 
Last edited:
Where did you get that openSSL version from? Are you using a different repository like maybe Dag Wieers or another? That might explain the difference.
All our Centos 6.x servers have OpenSSL 1.0.1e-fips 11 Feb 2013.
So if you would use the default repository the openSSL versions used would match.
 
I updated my openSSL from source.
This is a CentOS7 server.

I believe openSSL 1.0.1.e is outdated.
 
I did a Custombuild update and i now notice that after updating Curl my openSSL version is automatically downgraded form 1.0.2g to 1.0.1e-fips!
Code:
[root@custombuild ~]# curl -V
curl 7.49.0 (x86_64-pc-linux-gnu) libcurl/7.49.0 OpenSSL/1.0.1e zlib/1.2.7
Protocols: dict file ftp ftps gopher http https imap imaps pop3 pop3s rtsp smb smbs smtp smtps telnet tftp
Features: IPv6 Largefile NTLM NTLM_WB SSL libz UnixSockets
[root@vustombuild ~]# openssl version
OpenSSL 1.0.1e-fips 11 Feb 2013
Can anyone please tell me how to get current ( not outdated ) version with custombuild ( Curl ).
 
I followed http://forum.directadmin.com/showthread.php?t=52590

And now I was able to compile curl with the correct openSSL version.;)

Code:
[root@custombuild]# curl -V
curl 7.49.0 (x86_64-pc-linux-gnu) libcurl/7.49.0 OpenSSL/1.0.2h zlib/1.2.7 nghttp2/1.9.1
Protocols: dict file ftp ftps gopher http https imap imaps pop3 pop3s rtsp smb smbs smtp smtps telnet tftp
Features: IPv6 Largefile NTLM NTLM_WB SSL libz TLS-SRP HTTP2 UnixSockets
However now I am looking for a way to compile PHP-FPM with the same openSSL version.
This is not mentioned in the HOW-TO.

Anyone know that?
 
still the issue exists.
i find that on build script:
CURLV="`/usr/local/bin/curl --version | grep -m1 'libcurl' | awk '{ print $2}'`"
but when we do "curl" cooamd
it's goes to :

which curl
/bin/curl
so the solution is to configure it with bindir to /bin

also short solution:

mv /bin/curl /bin/curl.bak
ln -s /usr/local/bin/curl /bin/curl
 
Back
Top