0

Possible Duplicate:
Protocol https not supported or disabled in libcurl

I am trying to connect to a site via https using curl within php.

<?php
  $ch = curl_init();
  curl_setopt($ch, CURLOPT_URL, 'https://api-3t.paypal.com/nvp');
  $response = curl_exec($ch);
  curl_close($ch);
?>

curl reuturns with

* Protocol https not supported or disabled in libcurl

however using curl via command line works fine

  # curl https://api-3t.paypal.com/nvp

I am running CentOS 5.8, WHM 11.32.2

# curl-config --features
SSL
IPv6
libz
IDN
NTLM


# curl-config --protocols
HTTP
HTTPS
FTP
FTPS
FILE
TELNET
LDAP
DICT
TFTP
NTLM
Community
  • 1
  • 1
user1404902
  • 3
  • 1
  • 2

2 Answers2

0

Enable the extension php_sockets in php.ini

NT_
  • 2,216
  • 1
  • 18
  • 23
0

The curl binary that you are running from the command line is one thing ; but it's pretty much independent from the curl_*() functions you are calling from PHP.

A feature being available from the curl-command line tool will not (as you have noticed) necessarily be available from PHP.

Here, you'll probably have to recompile PHP, to make sure it's compiled with SSL support.

Pascal MARTIN
  • 395,085
  • 80
  • 655
  • 663