1

this is a curl command that works fine from command line:

curl "myUrl" -H "Host: myHost.com" -H "User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Firefox/45.0" -H "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8" -H "Accept-Language: hr-HR,hr;q=0.8,en-US;q=0.5,en;q=0.3" --compressed -H "Connection: keep-alive" -H "Cache-Control: max-age=0"

My problem is that im trying to execute this curl command from PHP, but I cannot get a valid response when executing it in PHP...

I spent hours trying to set up cURL correctly, but it always returns CURLE_RECV_ERROR 56 (Recv failure: Connection reset by peer), even when trying to execute it without PHP cURL extension, using exec($curl_command, $result);

So, how come it works normally using a command line, but not from php? What are the steps I should follow in order to fix this? I'm on shared server... btw, it also works fine when using firefox...

Thank you!

Boy
  • 1,182
  • 2
  • 11
  • 28

0 Answers0