Home  >  Article  >  Backend Development  >  What to do if yum remove php fails

What to do if yum remove php fails

藏色散人
藏色散人Original
2021-06-02 10:36:432711browse

Yum remove php failed solution: 1. Force deletion through the "#rpm -qa|grep php" command; 2. Modify the correct uninstallation sequence; 3. Check deletion through "#php -v" The situation is enough.

What to do if yum remove php fails

The operating environment of this article: linux5.9.8 system, PHP5.1.6 version, DELL G3 computer

Check the php version command:

#php -v

This command is not clean for deletion

#yum remove php

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

#php -v

. . . . .

Must be forcibly deleted

#rpm -qa|grep php

The prompt is 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

Be careful to uninstall the ones without dependencies first

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

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

Reuse # php -v

There is no prompt to view the version information

Install the latest PHP

wget
tar xzvf php-5.3.6.tar.gz
cd php-5.3.6
./configure --prefix=/usr/local/php

Recommended learning: "PHP Video Tutorial"

The above is the detailed content of What to do if yum remove php fails. 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