install php

Install PHP binaries.

bash
1
sudo apt install php8.2

Download composer installer.

bash
1
wget "https://raw.githubusercontent.com/composer/getcomposer.org/76a7060ccb93902cd7576b67264ad91c8a2700e2/web/installer" -O - -q | php -- --quiet

Move the executable to local bin directory.

bash
1
sudo mv composer.phar /usr/local/bin/composer

Add composer bin directory to the system path inside ~/.bashrc file.

nano ~/.bashrc
bash
1
export PATH="~/.config/composer/vendor/bin:$PATH"
source ~/.bashrc

List available php extensions.

bash
1
sudo apt search ^php8.2-