Lightsail | Error: HTTP/2 stream 0 was not closed cleanly

0

I have PHP page running on Lightsail Bitnami LAMP Stack. I am calling an external API to get market info from this PHP code using curl.

If i am calling this external API to get market info from my browser then i am getting JSON data with no issue.

But calling external API to get market info from my PHP curl code running on Lightsail Bitnami LAMP Stack returning Error: HTTP/2 stream 0 was not closed cleanly: INTERNAL_ERROR (err 2)

need help on this issue to resolve...

LK
asked 20 days ago173 views
2 Answers
0

Hi,

You should add the following line curl_setopt($curl, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1); (assuming that you use curl package in your PHP code and that should fix your issue.

Some older APIs etc. don't appear to be compatible with the latest HTTP version (v2). The newer version of CURL will use this protocol by default and as a result will fail.

Best,

Didier

profile pictureAWS
EXPERT
answered 20 days ago
profile picture
EXPERT
reviewed 12 days ago
0

I tried this earlier , after adding this the page will start keep loading and after some time it will just timeout... So not solving the problem.

just to tell, same PHP code working and getting proper response from the API if i run PHP code on Google cloud instance (Apache + PHP) like it is working on local. Is there any constraint on AWS security or some thing else.

LK
answered 20 days ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions