linux服务器中的远程访问问题小结
时间:2021-05-29 07:44:10|栏目:Linux|点击: 次
在php程序中运用fopen或者socket的时候,报一下错误:
php_network_getaddresses: getaddrinfo failed: Temporary failure in name。
我的代码如下
$handle = fopen(“http://www.baidu.com/”, “r”);
echo “handle:”.$handle;
这表示是无法连接到服务器,而我http://www.baidu.com/是可以访问的
这是服务器的防火墙的问题。将防火墙关闭掉,重启apache就可以了:
【root】#service iptables off
【root】#/etc/rc.d/init.d/named restart
(如果报错,先执行:yum install caching-nameserver,再执行以上命令)
【root】# pkill httpd
【root】# /usr/local/apache2/bin/httpd -k restart
当然还有可能是服务器的dns解析问题,请查看相关的文档。
php_network_getaddresses: getaddrinfo failed: Temporary failure in name。
我的代码如下
$handle = fopen(“http://www.baidu.com/”, “r”);
echo “handle:”.$handle;
这表示是无法连接到服务器,而我http://www.baidu.com/是可以访问的
这是服务器的防火墙的问题。将防火墙关闭掉,重启apache就可以了:
【root】#service iptables off
【root】#/etc/rc.d/init.d/named restart
(如果报错,先执行:yum install caching-nameserver,再执行以上命令)
【root】# pkill httpd
【root】# /usr/local/apache2/bin/httpd -k restart
当然还有可能是服务器的dns解析问题,请查看相关的文档。
上一篇:Linux 内核通用链表学习小结
栏 目:Linux
下一篇:linux下通过Squid反向代理搭建CDN缓存服务器的配置方法
本文标题:linux服务器中的远程访问问题小结
本文地址:http://www.codeinn.net/misctech/131055.html






