Skip to main content

Command Palette

Search for a command to run...

Ubuntu -Install PHP

Published
1 min read
M

Mohamad's interest is in Programming (Mobile, Web, Database and Machine Learning). He is studying at the Center For Artificial Intelligence Technology (CAIT), Universiti Kebangsaan Malaysia (UKM).

[1] Update Ubuntu

sudo apt-get update
sudo apt-get upgrade

[2] Add Repository for multiple PHP versions

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

[3] Install PHP 8

sudo apt-get install php8.1 php8.1-fpm

[4] Install some common PHP8.1 extensions

sudo apt-get install php8.1-mysql php8.1-mbstring php8.1-xml php8.1-gd php8.1-curl

[5] Check active PHP version

php -v

[6] Install multiple PHP versions

Refer https://techvblogs.com/blog/install-multiple-php-versions-on-ubuntu-22-04

3 views