0

I'm trying to whois query to whois name servers for domain availability. In localhost these codes are working great but in real server i'm getting 500 internal server error (Laravel blade files).

    
    @php

    $fp = fsockopen("whois.verisign-grs.com", 43);
    $domain= "example.com";

    fputs($fp, $domain);
    $whois = "";
    while (!feof($fp)) {
      $whois .= fgets($fp, 128);
    }

    fclose($fp);

    @endphp
  • check the error log to see what is causing the 500 error – lagbox Mar 27 '22 at 23:18
  • What is `$out`? Where do you use `$domain`? – Don't Panic Mar 27 '22 at 23:26
  • Sorry for variable names you can look at again now –  Mar 27 '22 at 23:33
  • I searched for "*php whois port 43*" and found many examples with code here on SO. Did you check any of those? Also, a `500 error` is just the generic error displayed on the front end to visitors, so they do not see any technical or sensitive info. If you check your web server, PHP, and Laravel logs, you will find much more detail and probably exaclty what the problem is. Have you done that? https://stackoverflow.com/questions/2687730/how-can-i-make-php-display-the-error-instead-of-giving-me-500-internal-server-er – Don't Panic Mar 28 '22 at 05:22

0 Answers0