Version 8 has moved json into core code and it is no longer a separate module.
Full details can be seen on PHP Watch here
As for getting PiHole running fully, you may find their forum more help as it's not a Pi specific program / issue as PHP 8 is not shipped by default yet.
To install php 8.0 add the repository:
sudo wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg
echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" | sudo tee /etc/apt/sources.list.d/php.list
sudo apt update
Then install the base and cli:
sudo apt install -y php8.0-common php8.0-cli
Then install the required modules:
sudo apt install -y php8.0-extension_name
e.g. for cURL and zip:
sudo apt install -y php8.0-curl php8.0-zip
For Apache use one / both of:
sudo apt install -y libapache2-mod-php8.0
sudo apt install -y php8.0-fpm
Full changed details start at this page
- The above does not replace earlier versions and may cause your scripts to fail if they are version dependant. You should remove earlier versions of PHP first using sudo apt purge '^php7.x.*' where 'x' is the sub-version of 7 installed (often 7.3 on Zeros and 7.4 on 2+ boards)
- I have not tried both versions together, nor have I tried sudo
update-alternatives --config php to switch between them.
- I do not believe v8.x will run on early ARMv6 chip sets (e.g. Pi 1 / zero / zero W) - you would need to compile the source yourself.
- There is no JSON component now as it's built in so any references to the file php8.0-json will ERROR.
- Checks within PHP scripts for the module being loaded using extension_loaded('json') or function_exists('json_decode') will PASS
- See here for full details