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

How to delete php on centos

藏色散人
Release: 2023-02-09 14:26:21
Original
5609 people have browsed it

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
Copy after login
Copy after login

The following command is not clean to delete

#yum remove php
Copy after login

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

#php -v
Copy after login
Copy after login

to the one with 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

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

and then use

# php -v
Copy after login

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!

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