Home > Operation and Maintenance > CentOS > How to delete php in centos7

How to delete php in centos7

王林
Release: 2020-09-28 14:51:43
Original
3778 people have browsed it

How to delete php in centos7: 1. Execute the [rpm -qa | grep php] command to view php related software packages; 2. Execute the [rpm -e] command to delete the php software package; 3. Execute [php - v] command to check whether the deletion is completed.

How to delete php in centos7

Check the php version command:

(Recommended tutorial: centos tutorial)

#php -v
Copy after login
Copy after login

below The command is not clean to delete

#yum remove php
Copy after login

because after using this command

#php -v
Copy after login
Copy after login

you will still see the version information.

Must be forcibly deleted, use the following command to view all php packages

#rpm -qa|grep php
Copy after login

The prompts are as follows:

#php-pdo-5.1.6-27.el5_5.3
#php-mysql-5.1.6-27.el5_5.3
#php-xml-5.1.6-27.el5_5.3
#php-cli-5.1.6-27.el5_5.3
#php-common-5.1.6-27.el5_5.3
#php-gd-5.1.6-27.el5_5.3
Copy after login

Be careful to uninstall those without dependencies first.

pdo is a dependency of mysql; common is a dependency of gd;

For example:

# rpm -e php-pdo-5.1.6-27.el5_5.3
error: Failed dependencies:
php-pdo is needed by (installed) php-mysql-5.1.6-27.el5_5.3.i386
Copy after login

So the correct uninstallation sequence is:

# rpm -e php-mysql-5.1.6-27.el5_5.3 
# rpm -e php-pdo-5.1.6-27.el5_5.3 
# rpm -e php-xml-5.1.6-27.el5_5.3 
# rpm -e php-cli-5.1.6-27.el5_5.3 
# rpm -e php-gd-5.1.6-27.el5_5.3 
# rpm -e php-common-5.1.6-27.el5_5.3
Copy after login

then Use

# php -v
Copy after login

to check the version information. There is no prompt anymore and the deletion is successful.

Related recommendations: php training

The above is the detailed content of How to delete php in centos7. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
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