Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Check domain availability using enom API in PHP

Tags:

php

I tested the sample php code of enom api in my localhost and it functions properly. However, when I tested it in my web server, it fails. This sample code checks domain availability using enom API. Any idea why this happens is much appreciated. Thanks. I'm new in using enom API.

  // URL for API request
  $url =  'https://resellertest.enom.com/interface.asp?command=check&sld=enom&tld=com&responsetype=xml&uid=resellid&pw=resellpw';
  // Load the API results into a SimpleXML object
  $xml = simplexml_load_file($url);

  // Read the results
  $rrpCode = $xml->RRPCode;
  $rrpText = $xml->RRPText;

  // Perform actions based on results
  switch ($rrpCode) {
    case 210:
      echo "Domain available";
      break;
    case 211:
      echo "Domain not available";
      break;
    default:
      echo $rrpCode . ' ' . $rrpText;
      break;
  }

Error:


Warning: simplexml_load_file(): SSL operation failed with code 1. OpenSSL Error messages: error:14077410:SSL routines:SSL23_GET_SERVER_HELLO:sslv3 alert handshake failure in /home/webdesigndavao/public_html/checkdomain.php on line 26

Warning: simplexml_load_file(): Failed to enable crypto in /home/webdesigndavao/public_html/checkdomain.php on line 26

Warning: simplexml_load_file(https://resellertest.enom.com/interface.asp?command=check&sld=enom&tld=com&responsetype=xml&uid=youruid&pw=passwordhere): failed to open stream: operation failed in /home/webdesigndavao/public_html/checkdomain.php on line 26

Warning: simplexml_load_file(): I/O warning : failed to load external entity "https://resellertest.enom.com/interface.asp?command=check&sld=enom&tld=com&responsetype=xml&uid=youruid&pw=passwordhere" in /home/webdesigndavao/public_html/checkdomain.php on line 26
bool(false)
like image 313
japhfortin Avatar asked Apr 28 '26 04:04

japhfortin


1 Answers

updating the OPENSSL version from 0.9.8 to 1.0.0 fixed my problem. Thanks

like image 174
japhfortin Avatar answered Apr 30 '26 19:04

japhfortin



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!