一开始安装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 指令做个软连接过去
