tags:

views:

4034

answers:

2

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?

+4  A: 

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.

tvanfosson
+2  A: 

also for ssl you need to prefix the host with ssl://

Martijn Laarman
This is the real answer, but tvanfosson clarified it :)
Jay