I want to use php 8.1 on Ubuntu server
Currently it works with php 7.4.30
lsb_release -a
returns
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 18.04.6 LTS
Release: 18.04
Codename: bionic
I followed tutorials and so I executed these commands
sudo apt update
sudo add-apt-repository ppa:ondrej/php
sudo apt update
sudo apt install php8.1
sudo apt-get install -y php8.1-cli php8.1-common php8.1-mysql php8.1-zip php8.1-gd php8.1-mbstring php8.1-curl php8.1-xml php8.1-bcmath
sudo systemctl restart apache2
Now when I do php -v
I see:
PHP 8.1.18 (cli) (built: Apr 14 2023 04:39:07) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.1.18, Copyright (c) Zend Technologies
with Zend OPcache v8.1.18, Copyright (c), by Zend Technologies
when I do
sudo update-alternatives --config php
Selection Path Priority Status
---------------------------------------------
* 0 /usr/bin/php8.1 81 auto mode
1 /usr/bin/php7.3 73 manual mode
2 /usr/bin/php7.4 74 manual mode
3 /usr/bin/php8.1 81 manual mode
Same for sudo update-alternatives --config phar
and sudo update-alternatives --config phar.phar
, php 8.1 is selected.
However, my application (a CMS) is still in php 7.4
I also tested with a simple php file with phpinfo();
What else can I check?