Home > Backend Development > PHP7 > 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)

藏色散人
Release: 2023-02-18 08:36:02
forward
3278 people have browsed it

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!

Related labels:
source:segmentfault.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template