Cannot save DNS settings in WebUI

The issue I am facing:
Facing a bit of a strange issue, i'm not able to save any of the DNS settings in the WebUI. For example, when i enable conditional forwarding and configure the IP and Local Domain Name and click save, i get the notification that the changes were successful, but then the page clears those configured settings. In addition, the status in the upper left shows "Unknown"

The only real errors i'm seeing are in the lighttpd error.log:

2020-05-28 11:37:59: (mod_fastcgi.c.421) FastCGI-stderr: PHP Notice: Undefined offset: 0 in /var/www/html/pihole/index.php on line 162
2020-05-28 11:38:00: (mod_fastcgi.c.421) FastCGI-stderr: PHP Notice: Undefined offset: 0 in /var/www/html/pihole/index.php on line 154
2020-05-28 11:38:00: (mod_fastcgi.c.421) FastCGI-stderr: PHP Notice: Undefined offset: 0 in /var/www/html/pihole/index.php on line 160
2020-05-28 11:38:00: (mod_fastcgi.c.421) FastCGI-stderr: PHP Notice: Undefined offset: 0 in /var/www/html/pihole/index.php on line 162

My debug token is: https://tricorder.pi-hole.net/l3sbu9mkbq

Details about my system:
My system is unique in that it's ARMv5, and I have compiled FTL from source.

What I have changed since installing Pi-hole:
None, i have tried multiple un-installations/re-installations with the same results.

Can we get the output from:

sudo cat -n /var/www/html/pihole/index.php | head -n 170 | tail -n 25

Sure thing!

   146	    );
   147	    $queryAds = file($queryAdsURL, FILE_IGNORE_NEW_LINES);
   148	    $queryAds = array_values(array_filter(preg_replace("/data:\s+/", "", $queryAds)));
   149	    $queryTime = sprintf("%.0f", (microtime(true)-$_SERVER["REQUEST_TIME_FLOAT"]) - $preQueryTime);
   150	
   151	    // Exception Handling
   152	    try {
   153	        // Define Exceptions
   154	        if (strpos($queryAds[0], "No exact results") !== FALSE) {
   155	            // Return "none" into $queryAds array
   156	            return array("0" => "none");
   157	        } else if ($queryTime >= ini_get("default_socket_timeout")) {
   158	            // Connection Timeout
   159	            throw new Exception ("Connection timeout (".ini_get("default_socket_timeout")."s)");
   160	        } elseif (!strpos($queryAds[0], ".") !== false) {
   161	            // Unknown $queryAds output
   162	            throw new Exception ("Unhandled error message (<code>$queryAds[0]</code>)");
   163	        }
   164	        return $queryAds;
   165	    } catch (Exception $e) {
   166	        // Return exception as array
   167	        return array("0" => "error", "1" => $e->getMessage());
   168	    }
   169	}
   170	

Looks like it's hanging on $queryAds[0]. Either there is no 0th index on that file, or your PHP doesn't like to index.

My PHP is very bad so I'll ask @promofaux to see if he's got a spare thought.

I was able to resolve this this morning, and the dashboard is reporting healthy and settings are being saved. It appears to have been an issue with permissions, and the www-data account was all screwy. I blew out the www-data account, purged lighttpd and re-installed to have the package recreate the www-data account.

Now my old pogoplug has a use case again!

Thanks for the help!