文件get-contents和var_dump中出现错误



我使用这个代码:

<?php
$token="683911895:AAGGVHW_RdP9h4dfvXYPABJe-RGdfyj125g";
$url="https://api.telegram.org/bot" . $token . "/getupdates";
$content=file_get_contents($url);
var_dump ($content);
?>

但它有两个错误:

1:警告:file_get_contents((:php_network_getaddresses:getaddrinfo失败:在数据库查找过程中发生了不可恢复的错误。在第5行上的C:\wamp\www\tbot.php中

2:警告:file_get_contents(https://api.telegram.org/bot683911895:AAGGVHW_RdP9h4dfvXYPABJe-RGdfyj125g/getupdates(:无法打开流:php_network_getaddresses:getaddrinfo失败:在数据库查找过程中发生不可恢复的错误。在第5行上的C:\wamp\www\tbot.php中

电报在我国被禁止

检查php设置"allow_url_fopen=On">

请在此处查看用法http://www.php.net/manual/en/function.file-get-contents.php

如果它仍然无法连接,那么您的服务器上的URL或DNS有问题。

最新更新