Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save hunterserror/1cec7988eb974d08a04e83ac67019997 to your computer and use it in GitHub Desktop.

Select an option

Save hunterserror/1cec7988eb974d08a04e83ac67019997 to your computer and use it in GitHub Desktop.
Install PHP (8.2, 8.1, 7.4) on Ubuntu 22.04
sudo apt update && sudo apt upgrade
sudo apt install software-properties-common ca-certificates lsb-release apt-transport-https
LC_ALL=C.UTF-8 sudo add-apt-repository ppa:ondrej/php
sudo apt update
sudo apt install php8.1
# Check active php version php -v
php -v
# Check system php version
php --version
# To install another php version same machine
sudo apt install php8.2
# Switch Default PHP Version
sudo update-alternatives --config php
@hunterserror

hunterserror commented Jan 18, 2024

Copy link
Copy Markdown
Author

very useful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment