I can't install any package related to PHP with yum

一个人想着一个人 提交于 2019-12-12 13:14:56

问题


I can't install any package related PHP, I get a yum error: No package php available. My PHP version is 5.4.37 on Centos 7. I installed remi for other purposes and I think that the repository is not compatible with PHP version but I don't know how to fix it.

[root@server ~]# sudo yum install php php-pear
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: centosmirror.netcup.net
 * epel: mirrors.n-ix.net
 * extras: centosmirror.netcup.net
 * remi: mirror5.layerjet.com
 * remi-safe: mirror5.layerjet.com
 * updates: centosmirror.netcup.net
No package php available.
No package php-pear available.
Error: Nothing to do

回答1:


You have, in yum configuration:

exclude=apache* httpd* mod_* mysql* MySQL* mariadb* da_* ftp exim* sendmail* php* bind-chroot* 

This is very probably a "panel" enabled server (cpanel or others), which provides its own PHP stack.

So by design, you cannot install "php*" packages from standard repository or any other 3rd party repository. Such distribution is so altered, that it is often considered as "Not CentOS".

So, better to ask your php stack provider for how to update it (if possible, without breaking the panel application)




回答2:


As suggested in other answer, this may be related to excludes set in yum.conf The command below allows to run the installation of excluded packages without modifying the conf file:

yum --disableexcludes=main install php

BUT

It seems like it might be better to re-install PHP by the means of the control panel installed. IE Cpanel - EasyApache..



来源:https://stackoverflow.com/questions/32546527/i-cant-install-any-package-related-to-php-with-yum

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!