php api curl xampp imgur

php - La solicitud cURL recibe la respuesta NULL de imgur api



xampp (1)

Eso es un problema SSL. Intente la siguiente línea antes de la llamada curl_exec

curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);

(Y puede agregar var_dump($response); para ver la respuesta del servidor).

$image = file_get_contents($_FILES[''upload''][''tmp_name'']); $id = ''myid''; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, ''https://api.imgur.com/3/image.json''); curl_setopt($ch, CURLOPT_POST, TRUE); curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE); curl_setopt($ch, CURLOPT_HTTPHEADER, array( ''Authorization: Client-ID '' . $id)); curl_setopt($ch, CURLOPT_POSTFIELDS, array( ''image'' => base64_encode($image) )); $response = curl_exec($ch); curl_close($ch); $response = json_decode($response);

este es el bloque de citas que tengo que hacer cargas anónimas de imágenes para imgur. funciona en xampp en mi máquina mac OS, pero no funciona en xampp en mi windows. También sé lo siguiente acerca de curl en windows xampp:

-it is enabled -it works when i try to grab the content of an url -it doesnt work when i try to make DELETE request to remove an anonymous image(the same code works on the mac os xampp)

calculé que hay algunas diferencias entre las configuraciones de cURL en las dos computadoras. ¡te agradecería si puedes mostrarme los caminos! gracias por adelantado.