I’d like to see my messages using Telegram API, like “/getupdates or “/getme”, and I read I have to user cURL, but unfortunately I don’t see anything on the page… blank page.
So what’s wrong whit my code blow here?
<?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;
?>
The error is: “url error: Received HTTP code 403 from proxy after CONNECT”
2
Answers
You should get a number of warnings if the error reporting is enabled.
For example, this one:
for this line specifically:
In addition, where
$handle
comes from? it should be$ch
, no?in apache/conf/extra there will be file httpd_proxy.conf, set
and below that add :
For ex :
1002 is destination port, restart apache and try