Uncuaght Error : call to undefined function json_encode in /var/www/html/admin/api.php

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

Expected Behaviour:

Stats and logs

Actual Behaviour:

No stats, no logs
Uncuaght Error : call to undefined function json_encode in /var/www/html/admin/api.php

Class "SQLite3 not found, ....

NOTE : PHP7.0 has been reinstalled and sqllite too before opening this

Debug Token:

https://tricorder.pi-hole.net/bo0b0z3k2d!

Install the PHP JSON package, php-json

Mcat12
Developer

     May

21
Install
the PHP JSON package, php-json


Visit Topic or reply to this
email to respond.

To unsubscribe from these emails, click here.

If you sent a response, it does not show up.

Hello MCat,
This is crazy, i reinstaled with pihole-r
sqlite seems to work (in command line)
all the package are present (json,...)
But still no stats : query logs says "Call to undifined function json_encoe in admin.php:139"
and the query log "Error Class SQLITE3 not found " in api_db.php:71
The web server has no error in its log and the pihole seems to work fine.

Would you have another idea ?
Thank you for your help

Tof

pi@noads:~ $ php-cgi -v
PHP 7.0.33-0+deb9u3 (cgi-fcgi) (built: Mar  8 2019 10:01:24)

pi@noads:~ $ apt policy php7.0-sqlite3
php7.0-sqlite3:
  Installed: 7.0.33-0+deb9u3
  Candidate: 7.0.33-0+deb9u3
  Version table:
 *** 7.0.33-0+deb9u3 500
        500 http://raspbian.raspberrypi.org/raspbian stretch/main armhf Packages
        100 /var/lib/dpkg/status

If not installed, run below ones with your PHP version:

sudo apt install php7.0-sqlite3

sudo phpenmod sqlite3 json

php-cgi -m

sudo service lighttpd restart

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