views:

943

answers:

2

I'm having trouble enabling the socket transport "ssl" in PHP. When I run my script, I get the error:

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

I'm running IIS6 on Windows and this is what I've done so far to try to get it working:

  • uncommented the php_openssl.dll and php_sockets.dll extensions in php.ini
  • made sure PHP was loading the ini file I made changes to (it is, and it's definitely loading other extensions, so I'm fairly sure this isn't the problem)
  • made sure php_openssl.dll and php_sockets.dll were in the correct location
  • copied ssleay32.dll and libeay32.dll to the main PHP folder, the WINDOWS folder and the WINDOWS/system32 folder
  • made sure the Windows path variable included the location of PHP
  • made sure the file permissions were correct on all the relevant files.

I've restarted IIS after pretty much every change, but I haven't had any luck. Is there anything obvious that I'm doing wrong? Is there anyway to troubleshoot this in smaller parts? (So I can figure out the problem by the process of elimination...?)

Unfortunately Windows/IIS aren't my area of expertise--I've been put in charge because nobody else seems to know anything... :S

Any help would be much appreciated :)

+1  A: 

Success!

After checking the log files and making sure the permissions on php_openssl.dll were correct, I googled the warning and found more things to try.

So I:

  • added C:\PHP\ext to the Windows path
  • added libeay32.dll and ssleay32.dll to C:\WINDOWS\system32\inetsrv
  • rebooted the server

I'm not sure which of these fixed my problem, but it's definately fixed now! :)

I found these things to try on this page: http://php.net/manual/en/install.windows.extensions.php

Thanks for your help!

taarradhin
A: 

I just ran into the same problem. I have written a post about the issue and how to solve it

http://www.devcha.com/2010/01/php-fsockopen-unable-to-connect-ssl.html

lordspace