Install PHP: Add PHP Repository

  • Ubuntu 22 comes with PHP 8.1, but you may want to move up to PHP 8.2.

  • You may even need to run an older version for application comaptibility

  • To do either, you'll need to add an external PHP repository

Run as root or via sudo:

# apt update
# apt install software-properties-common
# add-apt-repository ppa:ondrej/php