How to add PHP 8.3 in ubuntu WSL without removing existing php versions

Created at 06-Dec-2024 , By samar

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

Run the following command to install PHP 8.3

sudo apt install -y php8.3

Install PHP 8.3 Extensions (Optional)

sudo apt install -y php8.3-{cli,curl,mbstring,xml,zip,gd,mysql}

Verify PHP 8.3 Installation

Check the installed version of PHP 8.3

php8.3 -v

If you want to switch between different installed PHP versions (e.g., 8.1, 8.2, 8.3), use the following commands

sudo update-alternatives --config php

If you like what you are reading, please consider buying us a coffee ( or 2 ) as a token of appreciation.

Buy Me A Coffee

Don't forget to share this article! Help us spread the word by clicking the share button below.

We appreciate your support and are committed to providing you valuable and informative content.

We are thankful for your never ending support.