Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save praveencs87/97bf3241fe21610d5ef8387a9c087407 to your computer and use it in GitHub Desktop.
Save praveencs87/97bf3241fe21610d5ef8387a9c087407 to your computer and use it in GitHub Desktop.
Install php 7.4 version in ubuntu 22
6
It is the issue of the result of 22.10 not being released yet ppa:ondrej/php repository. It will fix it by ppa:ondrej/php, but I have found a solution for this,i don't think it is the best solution,
nano /etc/apt/sources.list.d/ondrej-ubuntu-php-kinetic.list
then add this line and save it
deb https://ppa.launchpadcontent.net/ondrej/php/ubuntu/ jammy main
#deb-src https://ppa.launchpadcontent.net/ondrej/php/ubuntu/kinetic main
then try to install it again
PHP 7.2
sudo apt-get install php7.2 php7.2-fpm
sudo apt-get install php7.2-mysql php7.2-mbstring php7.2-xml php7.2-gd php7.2-curl
PHP 8.0
sudo apt-get install php8.0 php8.0-fpm
sudo apt-get install php8.0-mysql php8.0-mbstring php8.0-xml php8.0-gd php8.0-curl
for this answer i have helped these link_01 link_02
now successfully installed PHP, so you can switch easily the PHP version,
sudo update-alternatives --config php
select the version for enter the number, now check the PHP version
php -v
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment