FIXED! PHP error (2): fsockopen(): unable to connect to 127.0.0.1:4711 (Connection refused) in /var/www/html/admin/scripts/pi-hole/php/FTL.php:47

For those of you with issues running Pihole on a Raspberry Pi with the following error, the solution is simple
PHP error (2): fsockopen(): unable to connect to 127.0.0.1:4711 (Connection refused) in /var/www/html/admin/scripts/pi-hole/php/FTL.php:47

Disable Ipv6 if you aren't using it. Reboot. DNS Resolver and FTL come up as normal and work fine.

To disable ipv6, you have to open /etc/sysctl.conf using any text editor and insert the following lines at the end:

net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1
net.ipv6.conf.lo.disable_ipv6 = 1

That observation seems coincidental.

That error is for an IPv4 address.
Disabling IPv6 has no impact on it.

I change line 47 of FTP.php from 1.0 to 30. So far so good in testing.
return @fsockopen($address, $port, $errno, $errstr, 30);

1 Like

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.