【发布时间】:2024-04-13 04:20:02
【问题描述】:
我这里有一个错误,我不知道问题到底出在哪里。 我正在尝试制作一个 PHP 文件并拒绝任何人使用该脚本,除了我在代码中输入的 IP:
$pass = '192.168.x.x'; //here is the ip of the client
if (file_get_contents('http://ipecho.net/plain') !== $pass) {
当我使用代码时我有问题
PHP Warning: file_get_contents(http://ipecho.net/plain): failed to open stream: Connection timed out
【问题讨论】:
-
allow_url_fopen是否启用? -
获取到 URL 的内容了吗?防火墙等。如果是这样 - 内容是什么
-
内容必须只是一个ip
标签: php warnings file-get-contents