Installing new PHP version - RaiderIO/keystone.guru GitHub Wiki

Installing PHP 8.2 (for example, change to 8.3 or whatever when you need it)

add-apt-repository ppa:ondrej/php
apt-get install php8.2 php8.2-fpm php8.2-cli -y
/usr/bin/php8.2 -v
apt-get install php8.2-xml
apt-get install php8.2-imagick
apt-get install php8.2-curl
apt-get install php8.2-zip
apt-get install php8.2-mysql
apt-get install php8.2-mbstring

Install LUA for the new PHP version.

update-alternatives --set php /usr/bin/php8.2 &&
update-alternatives --set phar /usr/bin/phar8.2 &&
update-alternatives --set phar.phar /usr/bin/phar.phar8.2 &&
update-alternatives --set phpize /usr/bin/phpize8.2 &&
update-alternatives --set php-config /usr/bin/php-config8.2 &&
mkdir /tmp/php-lua &&
cd /tmp/php-lua &&
git clone https://github.com/Wotuu/php-lua.git . &&
phpize &&
./configure &&
make &&
make install && 
rm -rf /temp/php-lua;

Then revert back to the current PHP version:

update-alternatives --set php /usr/bin/php7.4 &&
update-alternatives --set phar /usr/bin/phar7.4 &&
update-alternatives --set phar.phar /usr/bin/phar.phar7.4 &&
update-alternatives --set phpize /usr/bin/phpize7.4 &&
update-alternatives --set php-config /usr/bin/php-config7.4

Now, in /etc/nginx/sites-available you can change the PHP version to your new version. Access https://mapping.keystone.guru/phpinfo (for example) when logged in as an admin to see if the version is updated.