2017-02-06 10 views
-2

ドメインレジストラの詳細を検索しようとすると、「ソケットエラー******* - Unable to find theソケット転送 "http" - PHPの設定時に有効にするのを忘れましたか? "ソケットエラー******* - ソケットトランスポート "http"を見つけることができません

public function whoislookup($domain){ 
$domain = trim($domain); //remove space from start and end of domain 
if(substr(strtolower($domain), 0, 7) == "http://") $domain = substr($domain, 7); // remove http:// if included 
if(substr(strtolower($domain), 0, 4) == "www.") $domain = substr($domain, 4);//remove www from domain 
if(preg_match("/^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$/",$domain)) 
    return $this->queryWhois("whois.lacnic.net",$domain); 
elseif(preg_match("/^([-a-z0-9]{2,100})\.([a-z\.]{2,8})$/i",$domain)) 
{ 
    $domain_parts = explode(".", $domain); 
    $tld = strtolower(array_pop($domain_parts)); 
    $server = $this->WHOIS_SERVERS[$tld][0]; 
    if(!$server) { 
     return "Error: No appropriate Whois server found for $domain domain!"; 
    } 
    $res=$this->queryWhois($server,$domain); 
     while(preg_match_all("/Whois Server: (.*)/", $res, $matches)) 
     { 
      $server=array_pop($matches[1]); 
      $res=$this->queryWhois($server,$domain); 
     } 
    return $res; 
} 
else 
return "Invalid Input";} 

private function queryWhois($server,$domain) 
{ 
    $fp = @fsockopen($server, 43, $errno, $errstr, 20) or die("Socket Error " . $errno . " - " . $errstr); 
    if($server=="whois.verisign-grs.com") 
     $domain="=".$domain; 
     fputs($fp, $domain . "\r\n"); 
     $out = ""; 
     while(!feof($fp)){ 
      $out .= fgets($fp); 
     } 
    fclose($fp); 
    return $out; 
} 

異なる機能からドメイン名を取得しています。この機能でドメイン名を使用し、whoisデータベースを検索してドメイン登録の情報を取得します。

答えて

0

ちょうど今、私はルックアップが "ES"にしか働いておらず、ブラックリストなしでIPが必要であることを知りました。 Limitations mentioned here

0

上記コードのソケット方法論を使用してデータ転送を高速化する方法。

ありがとう、 ビジェイ

関連する問題