You are not logged in.

#1 2011-09-01 06:34:05

pag-r
Member
From: Poland
Registered: 2011-09-01
Posts: 7

fsockopen php_network_getaddresses permanent problem

Hi.
I'm completely new in Arch Linux, but not in Linux generally. I've installed Arch couple weeks ago and I like this distro a lot. But I have one problem with apache&php. Everytime when I try to use fsockopen (e.g. send an e-mail using SwiftMailer) command using browser I get those errors

Warning: fsockopen() [function.fsockopen]: php_network_getaddresses: getaddrinfo failed: Name or service not known in /home/pag-r/public_html/...
Warning: fsockopen() [function.fsockopen]: unable to connect to {domain}:25 (php_network_getaddresses: getaddrinfo failed: Name or service not known)
php_network_getaddresses: getaddrinfo failed: Name or service not known (0)

But when I try to execute php script like php -f script.php everything works great. So my idea is that problem is with apache, not php itself.
I've googled this problem couple times and found that restarting apache should help. But that resolution isn't good couse not everytime I restart apache this method works.
Somewhere in google I've found suggestion  that I should change DNS in /etc/resolv.conf and than restart apache.
So I've changed them to Google DNS (8.8.8.8 and 8.8.4.4) but that works only till I didn't shutdown my laptop.
I will be appreciate for any suggestions

Offline

Board footer

Powered by FluxBB