这是我的代码片段:
$fp = fsockopen($s['url'], 80, $errno, $errstr, 5);
if($fp){
fwrite($fp, $out);
fclose($fp);
运行代码后,输出:
无法连接到www.mydomain.net/1/file.php:80 (php_network_getaddresses: getaddrinfo失败:名称或服务未知)
我使用这个来提交GET数据到$s['url']
我不知道为什么。希望能得到帮助。
/etc/hosts
文件。确保URL指向正确的位置(通常是localhost)。 - tread