First add site on CloudPanel using another PHP version.
sudo apt install software-properties-common ca-certificates lsb-release apt-transport-https
sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt-get install -y php5.6-common php5.6-fpm php5.6 php5.6-zip php5.6-soap php5.6-opcache php5.6-mysql php5.6-cli php5.6-gd php5.6-curl php5.6-xsl php5.6-imap php5.6-intl php5.6-sqlite3 php5.6-bcmath php5.6-mbstring php5.6-readline
Copy the default configuration file for PHP 8.1 to PHP 5.6:
sudo cp /etc/php/8.1/fpm/pool.d/default.conf /etc/php/5.6/fpm/pool.d/
Edit the PHP 5.6 FPM configuration to change the listen port:
sudo nano /etc/php/5.6/fpm/pool.d/default.conf
Find the line that starts with listen
and change the port to 10000:
listen = 127.0.0.1:10000
6. Restart PHP-FPM
Restart PHP-FPM to apply the changes:
sudo systemctl restart php5.6-fpm
Finally, change PHP version of the site using CloudPanel