Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to find the socket transport "https"

Tags:

php

iis

fsockopen

I'm using this to check for the availability of a URL:

$fp = fsockopen($url, 443, $errno, $errstr); 

and I get this error back...

Warning: fsockopen() [function.fsockopen]: unable to connect to https://example.com/soapserver.php:443 (Unable to find the socket transport "https" - did you forget to enable it when you configured PHP?) in C:\Home etc etc....

I'm using an IIS server btw,( no its not my doing! ) so I think its something to do with not having open-ssl, but I'm not sure. Can anyone help please?

I did a phpinfo() and I do have ssl, but on IMAP and cURL, thats all.

Any ideas?

like image 447
Chris J Allen Avatar asked Dec 18 '08 17:12

Chris J Allen


2 Answers

Uncomment the line: extension=php_openssl.dll in php.ini

like image 52
Sérgio Avatar answered Sep 28 '22 00:09

Sérgio


You should be using just the hostname, not the URL in the fsockopen call. You'll need to provide the uri, minus the host/port in the actual HTTP headers. As @Martijin noted, and as listed in the manual page, you'll need to preface your host name with ssl:// for SSL or tls:// if using transport layer security.

Manual page for fsockopen. Look at Example #1.

like image 32
tvanfosson Avatar answered Sep 28 '22 01:09

tvanfosson