I am trying this on xampp on my local computer, but I'm getting no response from the server:
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://authserver.mojang.com/authenticate");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));
curl_setopt($ch, CURLOPT_POST, true);
$output = curl_exec($ch);
curl_close($ch);
return $output;