tkm Posted January 21, 2008 Share Posted January 21, 2008 Hello Guys, I am trying to open a socket with server on port 443 with php's fsockopen function . I am getting error. I have increased the time-out value with no success. What are the factors that could be generating the error? Any help would be much appreciated. Quote Link to comment https://forums.phpfreaks.com/topic/87054-error-with-fsockopen-function/ Share on other sites More sharing options...
PHP Monkeh Posted January 21, 2008 Share Posted January 21, 2008 What error are you getting exactly? Quote Link to comment https://forums.phpfreaks.com/topic/87054-error-with-fsockopen-function/#findComment-445213 Share on other sites More sharing options...
tkm Posted January 21, 2008 Author Share Posted January 21, 2008 if (!$sock = @fsockopen(((strtolower($protocol) == "https://")?"ssl://":"").$server, $port, $errno, $errstr, $this->connect_timeout)) { $this->log .= "Could not open connection. Error " .$errno.": ".$errstr."<br />\n"; return false; } the above is my code and I am getting the above error to say I can't open a connection... Thank you..... Quote Link to comment https://forums.phpfreaks.com/topic/87054-error-with-fsockopen-function/#findComment-445215 Share on other sites More sharing options...
Bauer418 Posted January 21, 2008 Share Posted January 21, 2008 You need SSL support compiled in PHP to connect to secure servers. Quote Link to comment https://forums.phpfreaks.com/topic/87054-error-with-fsockopen-function/#findComment-445234 Share on other sites More sharing options...
trq Posted January 21, 2008 Share Posted January 21, 2008 Remove the error supressor, we need an actual error. Quote Link to comment https://forums.phpfreaks.com/topic/87054-error-with-fsockopen-function/#findComment-445235 Share on other sites More sharing options...
tkm Posted January 21, 2008 Author Share Posted January 21, 2008 The error number I got is 0. Interestingly the errstr is "The operation completed successfully". This is after I took out @ sign and ran the script again. Thank you for trying to sort this out for me.... But I think "Bauer418" gave me a "could-be" reason for the issue. I have HTTPS option off with my PHP. And don't see any SSL info on my phpinfo() script. I believe I need to add the library of ssl with PHP. Bro any good resource link on that? Let me give a search in google,.. Quote Link to comment https://forums.phpfreaks.com/topic/87054-error-with-fsockopen-function/#findComment-445237 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.