centos7 反复安装php 结果最后无法卸载干净

原创
2016-06-23 13:49:47 1595浏览

一开始安装php,但是后来在网上摘抄了一些 yum install php-pdo php-zip 之类的,结果现在php无法卸载也无法重装
使用yum install php提示已经安装了。但是 php -v 却提示不存在。

整个过程:

[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]#


回复讨论(解决方案)

把php安装目录下的bin指向 ln xx /usr/bin试试

可以试试这样卸载:

rpm -qa | grep phprpm -e [上面输出的包]

http://www.phpthinking.com/archives/207 格式化然后一步步来

http://www.phpthinking.com/archives/207

yum 安装的你就 yum 卸载 然后自己编译一个 最后 php 指令做个软连接过去

声明:本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn核实处理。