Home >Operation and Maintenance >CentOS >How to delete php on centos

How to delete php on centos

藏色散人
藏色散人Original
2021-02-24 09:15:195621browse

How to delete php in centos: 1. View all php packages through the "#rpm -qa|grep php" command; 2. Uninstall the corresponding dependencies through the "rpm -e" command; 3. Reuse Just use the "php -v" command to check the version information.

How to delete php on centos

The operating environment of this article: linux5.9.8 system, PHP7.1, Dell G3 computer.

Linux CentOS completely uninstalls PHP

I am speechless. CentOS only has php version 5.1.6, and many open source CMS cannot be installed.

Check the php version command:

#php -v

The following command is not clean to delete

#yum remove php

Because after using this command, you will still see it if you use it again

#php -v

to the one with version information. . . . .

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

#rpm -qa|grep php

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

Note that to uninstall, you must first uninstall those without dependencies

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

例如:# 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

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

and then use

# php -v

to view There is no prompt for version information

[Recommended: PHP video tutorial]

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

Statement:
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