Install PHP on Ubuntu 22.04
11 March 2022 (Updated 27 May 2024)
On this page
Add PPA repository
Ubuntu’s default PPA repositories will probably not include the latest PHP version so you’ll want to add ppa:ondrej/php
.
Install PHP packages
Head over to the PHP website to check the current stable version. At the time of writing, this is 8.3.7.
Assuming we’ll use PHP with MySQL, we’ll want to install the following packages.
php_version=8.3 && sudo apt install php$php_version-fpm php$php_version-mysql php$php_version-xml php$php_version-curl
You may need to install more packages with time.
Verify installation
This should output something like:
Sources
Tagged:
PHP
Thanks for your comment . Once it's approved, it will appear here.
Leave a comment