What is blocking fsockopen?

前端 未结 4 1553
误落风尘
误落风尘 2021-01-12 10:26

After struggling for half a day, I finally manage to get reCAPTCHA to work by converting this function:

function _recaptcha_http_post($host, $path, $data, $p         


        
4条回答
  •  南笙
    南笙 (楼主)
    2021-01-12 11:17

    Woah,

      if( false == ( $fs = @fsockopen($host, $port, $errno, $errstr, 10) ) ) {
      die ("Could not open socket");
     }
    

    That doesn't make any sense surely. Try:

        $fs = fsockopen($host, $port, $errno, $errstr, 10); // @ ignores errors
     if(!$fs) die ("Could not open Socket");
    

    Also Skype also blocks port 80 sometimes.

提交回复
热议问题