Home  >  Article  >  Backend Development  >  How to install php7.2 on ubuntu (with the process of uninstalling lower versions)

How to install php7.2 on ubuntu (with the process of uninstalling lower versions)

藏色散人
藏色散人forward
2021-10-13 16:36:293130browse

This article is written by the PHP7 tutorial column to introduce to you how to uninstall and install php7.0 when installing the higher version of php7.2 on ubuntu. It has certain reference value. Friends in need can refer to it. I hope it will be helpful to everyone.

##1. Delete php related packages and configuration

sudo apt-get autoremove php7*
2. Delete the association

sudo find /etc -name "
php" |xargs rm -rf
3 , clear the dept list

sudo apt purge
dpkg -l | grep php| awk '{print $2}' |tr "\n" " "
4. Check Is the uninstallation clean (no return means the uninstallation is complete)

dpkg -l | grep php7.0
Then install the php7.0 version, because php7.0 has been moved from the package management in ubuntu Except, so we need to re-add authorization

add-apt-repository ppa:ondrej/php
apt-get update
apt-get install php7.0
through the above The command can install the php7.0 version. If it prompts that add-apt-repository does not exist, you can execute the following command

apt-get install software-properties-common
After the above operations, we Just downgraded the php version from php7.2 to php7.0

Personal test and it works

The above is the detailed content of How to install php7.2 on ubuntu (with the process of uninstalling lower versions). For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:segmentfault.com. If there is any infringement, please contact admin@php.cn delete