Installing PHP
-
2. Enabling PPA Repo
Add PHP PPA for Ubuntu GNU/Linux
-
3. Installing PHP 8.1
Now to Install PHP 8.1 on Ubuntu
Simply play:sudo apt install php8.1 php8.1-cli
This Setup includes also the most useful Extensions and Tools.
Then Test your new Php with:php -v
-
4. Searching PHP 8.1 Extensions
Again to Search PHP 8.1 Extensions.
So you can Search for the available PHP 8 Extensions running:
sudo apt search php8.1
And possibily refine the Result using a grep Pipe
sudo apt search php8.1 | grep [KEYWORD]
Like for instance:
sudo apt search php8.1 | grep mysql
Last, to Install multiple Packages at once you may use the following Syntax:
sudo apt install php8.1-{curl,xml,imagick,mysql,fpm,bz2}
-
5. Setting PHP Version
(Optional) In case to Manage Multiple PHP Versions on System
Use the Default CLI Tool:sudo update-alternatives --config php
If more than One then Simply Choose the Right PHP Release Entry.
Contents