Summary of remote access problems in linux server

  • 2020-05-06 12:01:36
  • OfStack

When using fopen or socket in the php program, report an error:

php_network_getaddresses: getaddrinfo failed: Temporary failure in name

My code is

$handle = fopen (" http: / / www. baidu. com/", "r");
"echo handle:". $handle;

That is unable to connect to the server, but I'm http: / / www baidu.
com/is to access it
This is a problem with the server's firewall. Turn off the firewall and restart apache:

【root】#service iptables off

# / root 】 【 etc/rc d/init d/named restart

(if an error is reported, first execute: yum install caching-nameserver, then execute the above command)

【root】# pkill httpd

# / usr local/root 】 【 apache2 / bin/httpd - k restart

Of course, it may be the dns parsing problem of the server, please check the relevant documents.

Related articles: