By default curl do not show any errors when you run curl call. We manual open it by adding some line of code so you can see what are the errors are coming when you running curl call.
The code i’ve written below will show all the errors in curl call and then you can easily rectify the errors.
if(curl_error($ch)) { echo 'error:' . curl_error($ch); }