-1
我想看看我的消息使用電報API,如「/ getupdates或」/ getme「,我讀了我必須用戶捲曲,但不幸的是我沒有看到任何東西在頁面上...空白頁。 那麼,什麼是這裏錯了白衣我的代碼的打擊當我在PHP中使用cURL出現錯誤「來自代理連接後的HTTP 403的HTTP 403」時應該怎麼做?
<?php
$botToken = "172894271:****myTelegramBotId****";
$botUrl = "https://api.telegram.org/bot" . $botToken;
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $botUrl."/geupdates");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
curl_close($ch);
//url error: Received HTTP code 403 from proxy after CONNECT
if(curl_errno($ch)) { echo 'Curl error: ' . curl_error($ch);}
echo $result;
?>
的錯誤是:「URL錯誤:接收的HTTP代碼403代理CONNECT後」
'error_reporting(E_ALL)'在'<?php'之後的頁面的頂部。此外,如果有任何評估錯誤響應:'if(curl_errno($ ch)){echo'Curl error:'。 curl_error($ ch);}' – Ohgodwhy
你的意思是「ini_set(」error_reporting「,E_ALL);」 ? – Donovant
編號我的意思是[error_reporting](http://php.net/manual/en/function.error-reporting.php) – Ohgodwhy