3

I am using PHP fsockopen() to finalize a payment between my server and PayPal. However, when I try to use an SSL connection, I get this error:

Warning: fsockopen() [function.fsockopen]: unable to connect to ssl://:443 
(Unable to find the socket transport "ssl" - did you forget to enable 
it when you configured PHP?)

I am sure that my call to the fsockopen() method is correct, as it worked correctly before I upgraded PHP on my development server.

It is important that this connection is encrypted, so I can't work around this.

I can't find any config about fsockopen() SSL connections in my php.ini file. Could anyone direct me to it?

Thank you for your help,
spryno724

Oliver Spryn
  • 16,871
  • 33
  • 101
  • 195
  • 1
    I know this might be a dumb question but...you DO have SSL installed and properly configured on your server, right? – rockerest Mar 31 '11 at 01:34
  • outbound connection propably doesnt need much besides base certs and openssl libraries to be present .. – rasjani Mar 31 '11 at 01:36
  • That's not a dumb question. I have OpenSSL installed, so that I can view encrypted pages with my browser. But, as for PHP itself, I'm not sure how I can tell. lol I'm obviously a noob at this. – Oliver Spryn Mar 31 '11 at 01:36

2 Answers2

5

It means that either your SSL module wasn't compiled with the rest of the PHP or it was compiled but its not enabled via the php.ini ..

Starting point: see what phpinfo() says about ssl ?

BenMorel
  • 34,448
  • 50
  • 182
  • 322
rasjani
  • 7,372
  • 4
  • 22
  • 35
  • I don't want to up tick this as "the answer" yet, but you should listen to the man. – k to the z Mar 31 '11 at 01:37
  • Would I check under the "Core" section for this? – Oliver Spryn Mar 31 '11 at 01:41
  • Check: Registered stream transports AND there should be a section called "openssl" .. if you dont have those, then you dont have the ssl compiled in or loaded. Did you compile php by yourself ? If not where you got it? What os platform you are running this ? – rasjani Mar 31 '11 at 01:46
  • Hmmm... looks like it wasn't compiled with my version of PHP. :S I'm looking under my extensions directory, for "php_openssl.dll" on a Windows environment, and its not there. I'll see if I can install it. – Oliver Spryn Mar 31 '11 at 01:46
  • Oh... and this is the latest version of XAMPP (1.7.4) for Windows. – Oliver Spryn Mar 31 '11 at 01:47
  • I guess, I was blind. There was "php_openssl.dll", but it wasn't loaded in "php.ini". I loaded it, and now all is working. Thank you for your help, rasjani! – Oliver Spryn Mar 31 '11 at 01:54
2

What OS are you using? If a *nix platform, PHP was likely compiled without SSL support. If its Windows, I'd check to make sure the SSL module is enabled in php.ini

Unsigned
  • 9,640
  • 4
  • 43
  • 72