After centos7 was repeatedly installed with php, it was finally impossible to uninstall and install php. after that, some yum install php-pdo php-zip files were excerpted on the Internet. as a result, php cannot be uninstalled or reinstalled.
If you use yum install php, the system prompts that the installation is complete. However, php-v prompts that the error does not exist.
The entire process:
[root@localhost conf.d]# whereis phpphp:[root@localhost conf.d]# yum remove phpLoaded plugins: fastestmirrorNo Match for argument: phpNo Packages marked for removal[root@localhost conf.d]# clear[root@localhost conf.d]# whereis phpphp:[root@localhost conf.d]# yum remove phpLoaded plugins: fastestmirrorNo Match for argument: phpNo Packages marked for removal[root@localhost conf.d]# rpm -qa | grep phpphp-cli-5.4.16-23.el7_0.x86_64php-pdo-5.4.16-23.el7_0.x86_64php-odbc-5.4.16-23.el7_0.x86_64php-snmp-5.4.16-23.el7_0.x86_64php-mbstring-5.4.16-23.el7_0.x86_64php-common-5.4.16-23.el7_0.x86_64php-process-5.4.16-23.el7_0.x86_64php-xml-5.4.16-23.el7_0.x86_64php-gd-5.4.16-23.el7_0.x86_64php-ldap-5.4.16-23.el7_0.x86_64php-soap-5.4.16-23.el7_0.x86_64php-xmlrpc-5.4.16-23.el7_0.x86_64[root@localhost conf.d]# yum install phpLoaded plugins: fastestmirrorLoading mirror speeds from cached hostfile * base: mirrors.linode.com * extras: mirrors.linode.com * updates: mirrors.linode.comResolving Dependencies--> Running transaction check---> Package php.x86_64 0:5.4.16-23.el7_0 will be installed--> Finished Dependency ResolutionDependencies Resolved================================================================================ Package Arch Version Repository Size================================================================================Installing: php x86_64 5.4.16-23.el7_0 updates 1.3 MTransaction Summary================================================================================Install 1 PackageTotal download size: 1.3 MInstalled size: 4.4 MIs this ok [y/d/N]: yDownloading packages:php-5.4.16-23.el7_0.x86_64.rpm | 1.3 MB 00:00Running transaction checkRunning transaction testTransaction test succeededRunning transactionWarning: RPMDB altered outside of yum. Installing : php-5.4.16-23.el7_0.x86_64 1/1 Verifying : php-5.4.16-23.el7_0.x86_64 1/1Installed: php.x86_64 0:5.4.16-23.el7_0Complete![root@localhost conf.d]# php -v-bash: php: command not found[root@localhost conf.d]# php -i-bash: php: command not found[root@localhost conf.d]#
Reply to discussion (solution)
Point the bin in the php installation directory to ln xx/usr/bin.
You can try to uninstall it like this:
Rpm-qa | grep phprpm-e [package output above]
Http://www.phpthinking.com/archives/207 formatting and then step by step
Http://www.phpthinking.com/archives/207
If yum is installed, you can uninstall yum and compile a final php command to make a soft connection.