欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  后端开发

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

程序员文章站 2022-05-15 09:29:46
...
一开始安装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 指令做个软连接过去