Enable SSL in PHP fsockopen()

Oliver Spryn picture Oliver Spryn · Mar 31, 2011 · Viewed 12.1k times · Source

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

Answer

rasjani picture rasjani · Mar 31, 2011

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 ?