无法在服务器上执行API,但在本地主机上

时间:2019-07-13 08:01:31

标签: php api

$ch = curl_init();

curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);

curl_setopt($ch, CURLOPT_URL, $fp);

curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 10);

curl_setopt($ch, CURLOPT_TIMEOUT_MS, 1000);

curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);

curl_setopt($ch, CURLOPT_VERBOSE, TRUE);

$result = curl_exec($ch);

$info = curl_getinfo($ch);

curl_close($ch);

$result =  json_decode($result, true);

0 个答案:

没有答案