Funny story: I tried installing it onto a fresh VM again, just to see what would happen, and it's working now. What did I do different?
This time I used Ubuntu Server 16.04, instead of Ubuntu Mini 16.04. I don't know what's different between the two in the end, since pihole should install all the packages it needs, right?
Either way, pi-hole is working great now on my Ubuntu Server VM install.
I have not been able to install it on a ordinary VM (Virtualbox, enough RAM and disk allocated), so for now let's just accept that it works fine on a regular installation.
For anyone just seeing this, the solution is that pi-hole is not compatible with Ubuntu Mini, for whatever reason. Use the full version of Ubuntu Server.
I have the exact same problem but running on Raspian. Did a fresh install of the OS and a fresh install of pi-hole yet still have the FTL offline error and web ui says no connection to api. I do notice that this only happens when switching to the dashboard. If I don't use the web ui (which of course means I can't view the graphs), pi-hole runs with no issue.
<?php
function connectFTL($address, $port=4711)
{
if($address == "127.0.0.1")
{
// Read port
$portfile = file_get_contents("/var/run/pihole-FTL.port");
if(is_numeric($portfile))
$port = intval($portfile);
}
// Open Internet socket connection
$socket = @fsockopen($address, $port, $errno, $errstr, 1.0);
return $socket;
}
$socket=connectFTL('127.0.0.1');
$request=">stats";
fwrite($socket, $request) or die('{"error":"Could not send data to server"}');
?>
executed sucessfully with home user role.
But I cannot execute the script with www-data user in Linux deployed with linuxtoy on android.
So the problem is here, the script cannot be changed into www-data user. So the fsockopen aciton is failed.
Only If you installed Linux on android with linuxtoy, you can do this:
replace www-data user with android user in files: /etc/lighttpd/lighttpd.conf, /etc/init.d/lighttpd
hi am also running into this issue i used linux deploy to install ubuntu bionic can you please explain your solution in more detail as am new to this
i got the change owner part but that's pretty much it, do i need to run your script? (if so, how)