Hello ppl, i need help here !
This is not my first try to solve this and i am not really a linux newbie, but this rapes my mind....
I got problems with FC1 on a server with static IP in a datacenter. Its a normal LAMP Webserver what runs since release of FC1 without any Problems. There are some virtual hosts with mainly PHP-coded pages on it. Some CMSs like PHPNuke, OSCommerce or XT-Commerce and some other webrelated staff. Some CMSs give u possibility, to include RSS-feeds, to mail the customers or users a password and so on. The Server uses currently my Providers DNS, but i have had the same problems with other DNSs, including my own named on the server.
1. fsockopen() cannot open external Files for usage i.e. with fopen()
2. PHP cannot mail out with sendmail -t -i
I thing, both problems got the one and same issue, so i am on the fsockopen() problem first.
I got this test, to checkout the fsockopen() function:
-
<?
$host = "www.hg-carstyling.de";
$fp = fsockopen ($host, 80, $errno, $errstr, 30);
echo "<b>Socket Test with $host </b><br>";
if (!$fp)
{
echo "FEHLER!:";
echo "$errstr ($errno)<br>\n";
} else
{
echo "PASSED!:<br>";
fputs ($fp, "GET / HTTP/1.0\r\n\r\n");
while (!feof($fp))
{
echo fgets($fp,128);
}
fclose($fp);
}
?>
-
This test fails
, but if i enter the requestet site in /etc/hosts, the test passes fine !
So u will say, its a DNS-Problem - ok, i thing so too.
So i talk to my (absolut linux competent) provider about this. He saw no problems, so i like to ask you here, what can be happened on a DNS, that such an error occurs ?
The Server itself got no probs, to resolve the remote location:
-
[root@isti542 root]# host
www.hg-carstyling.de
www.hg-carstyling.de has address 212.227.109.212
-
The Server can resolv its IP and reverse its name:
-
[root@isti542 root]# host isti542.fasthousing.de
isti542.fasthousing.de has address 62.141.41.94
[root@isti542 root]# host 62.141.41.94
94.41.141.62.in-addr.arpa domain name pointer isti542.fasthousing.de.
-
Sendmail can send mail from bash with no problems, but PHP cannot ?!?
Mails send via PHP mail() going to nirvana - as they had never be written, no logentry, no maillog, no message, nothing ...
Server can resolve all that ****, but PHP cannot ??!
While got some RSS-Staff on the site, i got tons of:
-
Warning: fsockopen(): php_network_getaddresses: getaddrinfo failed: Name or service not known in /home/rawfox/public_html/modules/Your_Account/index.php on line 427
Warning: fsockopen(): unable to connect to linuxcentral.com:80 in /home/rawfox/public_html/modules/Your_Account/index.php on line 427
-
on all sites on the server. If entered in /etc/hosts, all went fine and sure i can do a
-
[root@isti542 root]# ping linuxcentral.com
PING linuxcentral.com (69.3.255.70) 56(84) bytes of data.
64 bytes from lucy.linuxcentral.com (69.3.255.70): icmp_seq=0 ttl=54 time=135 ms
64 bytes from lucy.linuxcentral.com (69.3.255.70): icmp_seq=1 ttl=54 time=137 ms
64 bytes from lucy.linuxcentral.com (69.3.255.70): icmp_seq=2 ttl=54 time=138 ms
-
NSLookup is fine, too:
-
[root@isti542 root]# nslookup linuxcentral.com
Server: 62.141.40.11
Address: 62.141.40.11#53
Non-authoritative answer:
Name: linuxcentral.com
Address: 69.3.255.70
[root@isti542 root]# nslookup isti542.fasthousing.de
Server: 62.141.40.11
Address: 62.141.40.11#53
Non-authoritative answer:
Name: isti542.fasthousing.de
Address: 62.141.41.94
-
It seems, that PHP is not able to use the DNS and it needs the /etc/hosts to resolve Names ?!!?
Without /etc/hosts, PHP is not able to do a fsockopen() and i am sure, if i enter the relatet mailservers in /etc/hosts, PHP will mails out, but thats not testet.
-
php_network_getaddresses: getaddrinfo failed: Name or service not known
-
The Service is unknown for PHP, but not for the rest of the server - i´m totally confused
OK, maybe i found some help here on this topic.
regards
Michael