Php – How to install cURL with openssl on ubuntu server

curlopensslPHPssl

I am having a problem with cURL here.

My localhost has curl with openssl enabled, and thus my php code works fine. On running phpinfo() I get the following —

curl
cURL support          enabled
cURL Information  libcurl/7.19.5 OpenSSL/0.9.8g zlib/1.2.3.3 libidn/1.15 

However, on my other office server, curl does not have openssl support enabled. On running phpinfo() I get the following —

curl
cURL support          enabled
cURL Information  libcurl/7.20.1 zlib/1.2.3.3 

How do I get openssl support for curl ? Both – openssl and curl – are installed on the office server as of now.

I require immediate help.

Thank you.

Best Answer

Try to reinstall php5-curl from the official Ubuntu 10.04 repository.

The output of php5 -i (when php5-cli and php5-curl are installed) states it supports SSL:

cURL support => enabled
cURL Information => 7.19.7
Age => 3
Features
AsynchDNS => No
Debug => No
GSS-Negotiate => Yes
IDN => Yes
IPv6 => Yes
Largefile => Yes
NTLM => Yes
SPNEGO => No
SSL => Yes
SSPI => No
krb4 => No
libz => Yes
CharConv => No
Protocols => tftp, ftp, telnet, dict, ldap, ldaps, http, file, https, ftps
Host => x86_64-pc-linux-gnu
SSL Version => OpenSSL/0.9.8k
ZLib Version => 1.2.3.3

Since your output contains another version of libcurl you might want to check what distribution is actually running on your office server.