Enable SSL in PHP fsockopen()

2019-07-06 00:41发布

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

2条回答
叛逆
2楼-- · 2019-07-06 01:18

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

查看更多
欢心
3楼-- · 2019-07-06 01:20

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 ?

查看更多
登录 后发表回答