Home >Backend Development >PHP Tutorial >Example of php method to force uninstall under Linux
Originally, the Lamp environment had been installed on centOS6.6. Because the php5.3 version was relatively low, we used the remi source to upgrade to 5.5. Then the problem came: the php-xml used in the project was found under centOS. I can't find the yum installation package, and other extensions can't be found, so I have no choice but to roll back to the php version. However, there is no command to "downgrade" PHP, so you need to uninstall the original PHP and reinstall PHP.
To uninstall php, using the command yum remove php is not enough, because yum will not help you completely uninstall php. If you use php -v you can find that the version number of php still exists. .
The correct way to uninstall PHP is to delete the rpm installation package of PHP (in fact, yum installation still uses the rpm package fundamentally, but yum installation can solve the package dependency problem that occurs during rpm installation).
The command is as follows:
#rpm -qa|grep php lists all php related rpm packages
#rpm -e xxx xxx refers to the previous command line Just copy the package name of the rpm package. In this step, uninstall the installed PHP rpm package. Note that errors may occur due to possible dependencies, so you may need to adjust the order of the rpm packages to be written.
If you adjust the order of rpm packages and still cannot delete the remaining packages, you can solve the problem by force deletion:
#rpm -e xxx --nodeps where xxx still refers to the rpm package name
After forced deletion, you can reinstall php:
# yum -y install php can change the yum source and install other versions of php, because the source of centOS6.6 only gives Source of php5.3.
Related recommendations:
The above is the detailed content of Example of php method to force uninstall under Linux. For more information, please follow other related articles on the PHP Chinese website!