Pihole Web Interface Issue

One problem at a time.
Does that file exist ?

stat /usr/lib/php/20190902/mysqli.so

Apparently not:

 root@pi:/home/ape# stat /usr/lib/php/20190902/mysqli.so
stat: cannot stat '/usr/lib/php/20190902/mysqli.so': No such file or directory
root@pi:/home/ape#

What do you mean by that, did you search the package name and reinstalled it ?

Can you post output for those commands ?

I followed a tutorial online (just tried to find it again but can't) There were some commands I had to run that I believe had something to do with PHP.

Here is the output for the commands:

root@pi:/home/ape# dpkg -S /usr/lib/php/20190902/mysqli.so
php7.4-mysql: /usr/lib/php/20190902/mysqli.so
root@pi:/home/ape#     
root@pi:/home/ape# sudo apt install --reinstall php7.4-mysql
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
  easy-rsa libecap3 liblzo2-2 libpkcs11-helper1 linux-image-4.19.0-6-686-pae opensc opensc-pkcs11 php7.3-sqlite3
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 0 not upgraded.
Need to get 0 B/127 kB of archives.
After this operation, 0 B of additional disk space will be used.
(Reading database ... 202433 files and directories currently installed.)
Preparing to unpack .../php7.4-mysql_7.4.5-1+0~20200419.16+debian10~1.gbpc40fd0_i386.deb ...
Unpacking php7.4-mysql (7.4.5-1+0~20200419.16+debian10~1.gbpc40fd0) over (7.4.5-1+0~20200419.16+debian10~1.gbpc40fd0) ...
Setting up php7.4-mysql (7.4.5-1+0~20200419.16+debian10~1.gbpc40fd0) ...
Processing triggers for libapache2-mod-php7.4 (7.4.5-1+0~20200419.16+debian10~1.gbpc40fd0) ...
Processing triggers for php7.4-cli (7.4.5-1+0~20200419.16+debian10~1.gbpc40fd0) ...
Processing triggers for php7.4-cgi (7.4.5-1+0~20200419.16+debian10~1.gbpc40fd0) ....................................]
root@pi:/home/ape#     

Thats says its installed now.

stat /usr/lib/php/20190902/mysqli.so

dpkg -L php7.4-mysql

?

Ah, i'm getting a different output now:

root@pi:/home/ape# stat /usr/lib/php/20190902/mysqli.so
  File: /usr/lib/php/20190902/mysqli.so
  Size: 136620          Blocks: 272        IO Block: 4096   regular file
Device: 801h/2049d      Inode: 15206900    Links: 1
Access: (0644/-rw-r--r--)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 2020-05-14 20:06:28.000000000 +0100
Modify: 2020-04-19 09:43:53.000000000 +0100
Change: 2020-05-14 20:06:30.229663730 +0100
 Birth: -
root@pi:/home/ape#   

Somthing went wrong first time.
Try try again :wink:

Still get PHP warnings ?

Yes, I must've done something wrong the first time.

I am getting these PHP Warnings now:

PHP Warning:  PHP Startup: Unable to load dynamic library 'mysqli' (tried: /usr/lib/php/20190902/mysqli (/usr/lib/php/20190902/mysqli: cannot open shared object file: No such file or directory), /usr/lib/php/20190902/mysqli.so (/usr/lib/php/20190902/mysqli.so: undefined symbol: mysqlnd_global_stats)) in Unknown on line 0
PHP Warning:  Module 'exif' already loaded in Unknown on line 0
PHP Warning:  Module 'mbstring' already loaded in Unknown on line 0
  [i] Existing PHP installation detected : PHP version 7.4.5
PHP Warning:  PHP Startup: Unable to load dynamic library 'mysqli' (tried: /usr/lib/php/20190902/mysqli (/usr/lib/php/20190902/mysqli: cannot open shared object file: No such file or directory), /usr/lib/php/20190902/mysqli.so (/usr/lib/php/20190902/mysqli.so: undefined symbol: mysqlnd_global_stats)) in Unknown on line 0
PHP Warning:  Module 'exif' already loaded in Unknown on line 0
PHP Warning:  Module 'mbstring' already loaded in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library 'mysqli' (tried: /usr/lib/php/20190902/mysqli (/usr/lib/php/20190902/mysqli: cannot open shared object file: No such file or directory), /usr/lib/php/20190902/mysqli.so (/usr/lib/php/20190902/mysqli.so: undefined symbol: mysqlnd_global_stats)) in Unknown on line 0
PHP Warning:  Module 'exif' already loaded in Unknown on line 0
PHP Warning:  Module 'mbstring' already loaded in Unknown on line 0

Warnings didnt change right ?
Try reboot and check if file still there:

stat /usr/lib/php/20190902/mysqli.so

Just rebooted, file still exists but there is no change to the pi-hole Admin panel :confused:

root@pi:/home/ape# stat /usr/lib/php/20190902/mysqli.so
  File: /usr/lib/php/20190902/mysqli.so
  Size: 136620          Blocks: 272        IO Block: 4096   regular file
Device: 801h/2049d      Inode: 15206900    Links: 1
Access: (0644/-rw-r--r--)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 2020-05-14 20:13:48.177871082 +0100
Modify: 2020-04-19 09:43:53.000000000 +0100
Change: 2020-05-14 20:06:30.229663730 +0100
 Birth: -
root@pi:/home/ape#

Focus on the warnings first.
Also could try reinstall dependencies with sudo apt install --reinstall:

apt depends php7.4-mysql

EDIT: could you also post output for below ?

apt rdepends php7.4-mysql

EDIT2: ow and run whats recommended:

Good idea.

Output from depends:

root@pi:/home/ape# apt depends php7.4-mysql
php7.4-mysql
  Depends: php-common (>= 1:73)
  Depends: ucf
  Depends: php7.4-common (= 7.4.5-1+0~20200419.16+debian10~1.gbpc40fd0)
  Depends: libc6 (>= 2.15)
root@pi:/home/ape#

Output from rdepends:

root@pi:/home/ape# apt rdepends php7.4-mysql
php7.4-mysql
Reverse Depends:
  Depends: php7.4-mysql-dbgsym (= 7.4.5-1+0~20200419.16+debian10~1.gbpc40fd0)
  Depends: php-mysql
root@pi:/home/ape#

I also reinstalled the dependencies. Here's the list of PHP Warnings after the commands:

PHP Warning:  PHP Startup: Unable to load dynamic library 'mysqli' (tried: /usr/lib/php/20190902/mysqli (/usr/lib/php/20190902/mysqli: cannot open shared object file: No such file or directory), /usr/lib/php/20190902/mysqli.so (/usr/lib/php/20190902/mysqli.so: undefined symbol: mysqlnd_global_stats)) in Unknown on line 0
PHP Warning:  Module 'exif' already loaded in Unknown on line 0
PHP Warning:  Module 'mbstring' already loaded in Unknown on line 0
  [i] Existing PHP installation detected : PHP version 7.4.5
PHP Warning:  PHP Startup: Unable to load dynamic library 'mysqli' (tried: /usr/lib/php/20190902/mysqli (/usr/lib/php/20190902/mysqli: cannot open shared object file: No such file or directory), /usr/lib/php/20190902/mysqli.so (/usr/lib/php/20190902/mysqli.so: undefined symbol: mysqlnd_global_stats)) in Unknown on line 0
PHP Warning:  Module 'exif' already loaded in Unknown on line 0
PHP Warning:  Module 'mbstring' already loaded in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library 'mysqli' (tried: /usr/lib/php/20190902/mysqli (/usr/lib/php/20190902/mysqli: cannot open shared object file: No such file or directory), /usr/lib/php/20190902/mysqli.so (/usr/lib/php/20190902/mysqli.so: undefined symbol: mysqlnd_global_stats)) in Unknown on line 0
PHP Warning:  Module 'exif' already loaded in Unknown on line 0
PHP Warning:  Module 'mbstring' already loaded in Unknown on line 0

EDIT: Here's the output from the autoremove as recommended:

root@pi:/home/ape# sudo apt autoremove
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be REMOVED:
  easy-rsa libecap3 liblzo2-2 libpkcs11-helper1 linux-image-4.19.0-6-686-pae opensc opensc-pkcs11 php7.3-sqlite3
0 upgraded, 0 newly installed, 8 to remove and 0 not upgraded.
After this operation, 157 MB disk space will be freed.
Do you want to continue? [Y/n] y
(Reading database ... 202436 files and directories currently installed.)
Removing easy-rsa (3.0.6-1) ...
Removing libecap3:i386 (1.0.1-3.2) ...
Removing liblzo2-2:i386 (2.10-0.1) ...
Removing libpkcs11-helper1:i386 (1.25.1-1) ...
Removing linux-image-4.19.0-6-686-pae (4.19.67-2+deb10u2) ...
/etc/kernel/postrm.d/initramfs-tools:
update-initramfs: Deleting /boot/initrd.img-4.19.0-6-686-pae
/etc/kernel/postrm.d/zz-update-grub:
Generating grub configuration file ...
Found background image: /usr/share/images/desktop-base/desktop-grub.png
Found linux image: /boot/vmlinuz-4.19.0-9-686-pae
Found initrd image: /boot/initrd.img-4.19.0-9-686-pae
Found linux image: /boot/vmlinuz-4.19.0-8-686-pae
Found initrd image: /boot/initrd.img-4.19.0-8-686-pae
done
Removing opensc (0.19.0-1) ...
Removing opensc-pkcs11:i386 (0.19.0-1) ...
Removing php7.3-sqlite3 (7.3.17-1+0~20200419.57+debian10~1.gbp0fda17) ...
Processing triggers for mime-support (3.62) ...
Processing triggers for gnome-menus (3.31.4-3) ...
Processing triggers for libc-bin (2.28-10) ...
Processing triggers for man-db (2.8.5-2) ...
Processing triggers for desktop-file-utils (0.23-4) ...
root@pi:/home/ape#    

Try reinstall below three:

sudo apt install --reinstall php7.4-cgi php7.4-cli php7.4-common

If that dont fix warnings, try purge them (might break other software):

sudo dpkg -P php7.4-cgi php7.4-cli php7.4-common

And reinstall:

sudo apt install --reinstall php7.4-cgi php7.4-cli php7.4-common

The reinstall command sadly did not fix the PHP Warnings. I tried purging them with the command you kindly provided but I received this output:

root@pi:/home/ape# sudo dpkg -P php7.4-cgi php7.4-cli php7.4-common
dpkg: dependency problems prevent removal of php7.4-cgi:
 php-cgi depends on php7.4-cgi.

dpkg: error processing package php7.4-cgi (--purge):
 dependency problems - not removing
dpkg: dependency problems prevent removal of php7.4-cli:
 php7.4-cgi depends on php7.4-cli.
 libapache2-mod-php7.4 depends on php7.4-cli.

dpkg: error processing package php7.4-cli (--purge):
 dependency problems - not removing
dpkg: dependency problems prevent removal of php7.4-common:
 php7.4-zip depends on php7.4-common (= 7.4.5-1+0~20200419.16+debian10~1.gbpc40fd0).
 php7.4-xml depends on php7.4-common (= 7.4.5-1+0~20200419.16+debian10~1.gbpc40fd0).
 php7.4-sqlite3 depends on php7.4-common (= 7.4.5-1+0~20200419.16+debian10~1.gbpc40fd0).
 php7.4-readline depends on php7.4-common (= 7.4.5-1+0~20200419.16+debian10~1.gbpc40fd0).
 php7.4-opcache depends on php7.4-common (= 7.4.5-1+0~20200419.16+debian10~1.gbpc40fd0).
 php7.4-mysql depends on php7.4-common (= 7.4.5-1+0~20200419.16+debian10~1.gbpc40fd0).
 php7.4-mbstring depends on php7.4-common (= 7.4.5-1+0~20200419.16+debian10~1.gbpc40fd0).
 php7.4-json depends on php7.4-common (= 7.4.5-1+0~20200419.16+debian10~1.gbpc40fd0).
 php7.4-intl depends on php7.4-common (= 7.4.5-1+0~20200419.16+debian10~1.gbpc40fd0).
 php7.4-curl depends on php7.4-common (= 7.4.5-1+0~20200419.16+debian10~1.gbpc40fd0).
 php7.4-cli depends on php7.4-common (= 7.4.5-1+0~20200419.16+debian10~1.gbpc40fd0).
 php7.4-cgi depends on php7.4-common (= 7.4.5-1+0~20200419.16+debian10~1.gbpc40fd0).
 php7.4 depends on php7.4-common.
 libapache2-mod-php7.4 depends on php7.4-common (= 7.4.5-1+0~20200419.16+debian10~1.gbpc40fd0).

dpkg: error processing package php7.4-common (--purge):
 dependency problems - not removing
Errors were encountered while processing:
 php7.4-cgi
 php7.4-cli
 php7.4-common
root@pi:/home/ape#

And if you purge them individually not in one command ?

Dependencies are taken care of by apt.
But if you purge with apt, it will probably remove a whole lot of packages that you might not want to be removed.
But as a last resort.
Or wait for someone with better advice as this is not my usual business :wink:

I'm getting the same error message while trying to remove them individually :confused:

root@pi:/home/ape# sudo dpkg -P php7.4-cgi
dpkg: dependency problems prevent removal of php7.4-cgi:
 php-cgi depends on php7.4-cgi.

dpkg: error processing package php7.4-cgi (--purge):
 dependency problems - not removing
Errors were encountered while processing:
 php7.4-cgi
root@pi:/home/ape# sudo dpkg -P php7.4-cgi
dpkg: dependency problems prevent removal of php7.4-cgi:
 php-cgi depends on php7.4-cgi.

dpkg: error processing package php7.4-cgi (--purge):
 dependency problems - not removing
Errors were encountered while processing:
 php7.4-cgi
root@pi:/home/ape#

I've tried removing php-cgi and php7.4-cgi individually but apparently they depend upon eachother?

Yeah I believe php-cgi is some sort of place holder for php7.4-cgi.
This is usually the part where I get lost in dependency forrest.

No worries - thank you so much for helping so far. I'll mess around for a little bit tomorrow morning and see if I can do anything. If all fails I will just reinstall Debian 10 as a last resort. :slight_smile:

Last resort:

@LVTS
Do you require PHP for Pi-hole only or do you run other web/PHP applications on the same machine? Otherwise I would try to clean up the mess of 3 different PHP versions, I would not wonder that this causes issues when using regular CGI.

Since you are on Debian Buster, the default PHP version should be PHP7.3, so e.g. php-cgi should be a meta-package that pulls php7.3-cgi. Since it your case it pulls php7.4-cgi, I guess you have deb.sury.org PHP repo installed, Ondrejs unofficial PHP repo which already switched to PHP7.4. As I am not sure if Pi-hole already supports it, in case I would revert to/use PHP7.3. To check which repos are installed:

ls -l /etc/apt/sources.list{,.d/*.list}

Ah I saw you already tried that. I would start with purging PHP7.0 which you should definitely not use on Debian 10/Buster:

apt purge 'php7.0-*'

Then purge the meta packages, which have no use themselves anyway:

apt purge php php-{cgi,intl,pear,sqlite3,xml}

I see you have MySQL installed + the PHP modules, which fail. However Pi-hole uses SQLite only, hence as long as you do not have another web application that uses MySQL/MariaDB, then you can purge them as well:

apt purge 'php*-mysql'

Since you use Lighttpd and not Apache (right?), the Apache PHP module can be purged:

apt purge libapache2-mod-php7.4

Then you need to decide whether to stay with PHP7.4 from Ondrejs repo or use PHP7.3 which is native on Debian 10/Buster, depending on this the last purge can be done:

apt purge 'php7.X-*'

If you choose to use PHP7.3, then you must remove Ondrejs repo, where the output of above check shows you where to find the file or entry. This is required since the Pi-hole installer currently pulls the php-intl meta package instead of the versioned package based on installed PHP version, so this must pull PHP7.3 then, hence must be the one from official Debian repo. If you want to use PHP7.4, then Ondrejs repo must stay in place accordingly.

Assure again that all modules for the chosen PHP version are installed:

apt install php7.Y-intl php7.Y-sqlite3 php7.Y-xml php7.Y-cgi

Final cleanup of dependencies:

apt autopurge
1 Like