Home > Mobile >  PHP Warning: failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request
PHP Warning: failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request

Time:02-23

this is the error I receive:

[22-Feb-2022 16:59:30 UTC] PHP Warning: file_get_contents(https://licensor.altervista.org/?key=*****): failed to open stream: HTTP request failed! HTTP/1.1 400 Bad Request in /home2//public_html/wp-content/themes//*****/license-protection.php on line 442

This is where the error occurs:

//callback license key server
ini_set('display_errors', '0');

define('KEY_CODE', MOVIEWP_LICENSE);
$LICENSE_KEY = KEY_CODE;

$keydata = file_get_contents("https://licensor.altervista.org/?key=$LICENSE_KEY");

Can you help me solve it, thank you very much.

CodePudding user response:

Try:

...
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, "https://licensor.altervista.org/?key=$LICENSE_KEY");
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($curl);
curl_close($curl);
...

The above requires the curl extension to be enabled on your php installation. It is usually enabled.

  • Related