Pihole web admin issue

Please follow the below template, it will help us to help you!

Expected Behaviour:

Functional web admin UI w/ data.

Actual Behaviour:

No data (e.g. '---' in the colored boxes and the graphs are grayed out on the Dashboard), only some parts working (e.g. Settings, Update Gravity) , error message pop-up text below.

Debug Token:

https://tricorder.pi-hole.net/qd75bbua27

I'm getting the following error message when clicking on Query Log, Long-term Data / Query Log and Network:

> An unknown error occured while loading the data.
>

> Fatal error: Uncaught Error: Call to undefined function json_encode() in /var/www/html/admin/api.php:139
> Stack trace:
> #0 {main}
> thrown in /var/www/html/admin/api.php on line 139

Try sudo apt install php7.0-json

Thanks for the quick reply.

After sudo apt install php7.0-json

Reading state information... Done
php7.0-json is already the newest version (7.0.33-0+deb9u3).
php7.0-json set to manually installed.
The following packages were automatically installed and are no longer required:
coinor-libipopt1v5 libmumps-seq-4.10.0 libraw15 realpath
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 38 not upgraded.

No change in the web admin behavior.

Bump... has anyone else had this issue or have any additional suggestions on how to resolve it?

Thanks!

Looks like you have a lot of updates to apply. Run sudo apt update && sudo apt upgrade and see if the updated packages solves the issue.

Ran the update, rebooted and am still getting the same error message and no data in the admin UI.

Make sure you are using the right PHP version (if using 5, you will need to install the PHP 5 version of the JSON library).

That's just the hint I needed... after a bit of searching the following worked:

sudo apt purge php7.0-json php7.0-sqlite3
sudo apt install php7.0-json php7.0-sqlite3
sudo apt install --reinstall php7.0-cli php7.0-cgi
sudo phpenmod json sqlite3
sudo service lighttpd restart

The 'Solution' from the following thread:

Thanks for the help everyone!

2 Likes

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