I am writing a domain registration script, when I connect to the EPP server I get the following error:
PHP Fatal error: Uncaught Exception: Received HTTP/0.9 when not allowed
Curl has nghttp2 included so that is not the error
I'm running PHP 7.4
$xml = '<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<epp xmlns="urn:ietf:params:xml:ns:epp-1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="urn:ietf:params:xml:ns:epp-1.0
epp-1.0.xsd">
<command>
<login>
......removed ...
</login>
</command>
</epp>';
//The URL that you want to send your XML to.
$url = 'https://xxxxx.com:700';
if(function_exists('curl_init') === true){
//curl_init is not defined
echo"cURL enabled";
}
//Initiate cURL
$curl = curl_init($url);
//Set the Content-Type to text/xml.
curl_setopt ($curl, CURLOPT_HTTPHEADER, array("Content-Type: text/xml"));
//Set CURLOPT_POST to true to send a POST request.
curl_setopt($curl, CURLOPT_POST, true);
//Attach the XML string to the body of our request.
curl_setopt($curl, CURLOPT_POSTFIELDS, $xml);
//Tell cURL that we want the response to be returned as
//a string instead of being dumped to the output.
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
//Execute the POST request and send our XML.
$result = curl_exec($curl);
//Do some basic error checking.
if(curl_errno($curl)){
throw new Exception(curl_error($curl));
echo $curl;
}
Any ideas? Thanks