Freebase API call works in browser but fails with curl

邮差的信 提交于 2019-12-06 00:03:18

For me by adding the below line worked.

curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); 
user729928

My guess is that you are seeing NULL because the curl_exec returns false and then the json_decode converts the false to NULL.

This means, as you suspected, that curl_exec is failing. I'm not sure why, but I would start by debugging with curl_error() and curl_errno() to get more information on what is causing curl to fail.

Reference: curl_exec() always returns false

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!