简体   繁体   English

yum install php-mysql 无法安装 Centos

[英]yum install php-mysql unable to install Centos

I am having difficulty installing php-mysql, I do the following:我在安装 php-mysql 时遇到困难,我执行以下操作:

yum -y install php-mysql

but get the following:但得到以下内容:

Loaded plugins: fastestmirror, security
Loading mirror speeds from cached hostfile
 * base: centos.escapemg.com
 * extras: mirror.chpc.utah.edu
 * updates: mirrors.xmission.com
Setting up Install Process
No package php-mysql available.
Error: Nothing to do

I did a yum repolist disabled and enabled yum-config-manager --enable C6.1-base but still keep getting the same No package php-mysql available.我做了一个yum repolist disabled并启用了yum-config-manager --enable C6.1-base但仍然保持相同的 No package php-mysql available。

I figured it out, it appeared that mysql in /etc/yum.conf there was a line exclude=mysql* php* once I commented it out, I was able to yum install mysqlnd .我想通了,似乎/etc/yum.conf中的 mysql 有一行exclude=mysql* php*一旦我将其注释掉,我就可以yum install mysqlnd Thanks to everyone who感谢所有的人

The obvious problem is that you don't have a repository with PHP installed.明显的问题是您没有安装 PHP 的存储库。 It's odd that base doesn't have one but you can fix this by installing the remi repository , which has PHP 5.4 through 5.6 (just enable the version you want)奇怪的是 base 没有,但你可以通过安装remi 存储库来解决这个问题,它有 PHP 5.4 到 5.6(只需启用你想要的版本)

I would highly suggest installing php-mysqlnd instead of php-mysql , as that is the native driver and does not require any mysqlclientXX libraries, which are a mess to maintain.我强烈建议安装php-mysqlnd而不是php-mysql ,因为这是本机驱动程序,不需要任何mysqlclientXX库,维护起来很麻烦。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM