php-binance-api icon indicating copy to clipboard operation
php-binance-api copied to clipboard

how to solve Curl error: HTTP/2 stream 0 was not closed cleanly: PROTOCOL_ERROR (err 1)

Open ThuretGbenougan opened this issue 3 years ago • 1 comments

Curl error: HTTP/2 stream 0 was not closed cleanly: PROTOCOL_ERROR (err 1)

Short Description:

  • when i try to execute this $ticker = $api->prices(), i have Curl error: HTTP/2 stream 0 was not closed cleanly: PROTOCOL_ERROR (err 1). i use laravel v8

Platform:

  • windows

php version:

  • 8.1.3

code in my controller

use Binance\API;

$api = new \API("<api key>","<secret>");
$ticker = $api->prices();
print_r($ticker); // List prices of all symbols

result

Curl error: HTTP/2 stream 0 was not closed cleanly: PROTOCOL_ERROR (err 1)

thank you

ThuretGbenougan avatar Sep 05 '22 09:09 ThuretGbenougan

Hi,

Can you please provide the extract stack tracce error. It should look something along the lines of

[09-Jul-2013 18:26:16 UTC] PHP Fatal error:  Uncaught exception 'Exception' with message 'The requested file does not exists.' in C:\sites\wonderfulproject\script.php:40
Stack trace:
#0 {main}
  thrown in C:\sites\wonderfulproject\script.php on line 40

you can also downgrade to http1.1 by using curl_setopt($curl, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);

curl protocol error usually is a system problem and not related to the application itself

dmzoneill avatar Sep 05 '22 13:09 dmzoneill