php fsockopen unable to connect ssl extension under Windows XP/Vista
I've been testing with PayPal sandbox on my Windows Vista machine.
It is running Apache/2.0.59 (Win32) PHP/5.2.12
My php is installed in c:\php5 yours could be in c:\php
My goal was to use fsockopen with "ssl://" stream but I was receiving this error:
Warning: fsockopen() [function.fsockopen]: unable to connect to ssl://www.sandbox.paypal.com:443 (Unable to find the socket transport "ssl" - did you forget to enable it when you configured PHP?)My Solution
1. I had to enable: php_openssl.dll from php.ini
extension=php_openssl.dll
2. I also made sure that extension_dir points to my extension directory, not the default ./ location.
extension_dir = "c:/php5/ext"
3. I found the comment of mtudor AT icefusion DOT co uk very valuable.
I renamed these 2 files so the same files are loaded from c:\php5
C:\Apache2\bin\ssleay32.dll => old-ssleay32.dll
C:\Apache2\bin\ssleay32.dll => old-libeay32.dll
If everything is OK your phpinfo(); should list these stream socket transports
Registered Stream Socket Transports tcp, udp, ssl, sslv3, sslv2, tlsRelated
- http://www.php.net/manual/en/openssl.installation.php
- http://stackoverflow.com/questions/1705856/socket-transport-ssl-in-php-not-enabled
Good luck!
Svetoslav
10 comments:
thank you for your solution. helps a lot! :)
great! :)
Great! In my case, i don't need to rename the files in Apache. I only enable the open_ssl.
cool
thanks alot
Thank u friend it helped me a lot...
god bless!
cool
This was very helpful, thanks.
I just need to enable ssl extension:
extension=php_openssl.dll
in php.ini file.
Voila!! that's working. And please stop this recaptcha. It's pathetic.
Thank you a lot, very useful post!
Post a Comment