如何为PHP启用mysqlnd? [英] How to enable mysqlnd for php?

查看:339
本文介绍了如何为PHP启用mysqlnd?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经安装并运行了PHP(版本:5.3.17),我想切换到mysqlnd(在phpinfo中,mysqlnd根本不存在).

I have PHP installed and running (version: 5.3.17) and I want to switch to mysqlnd (in the phpinfo mysqlnd does not exist at all).

我了解到要对其进行设置,您需要更新./configure命令:

I read that in order to set it, you need to update the ./configure command:

./configure --with-mysql=mysqlnd \
--with-mysqli=mysqlnd \
--with-pdo-mysql=mysqlnd \

当我尝试使用yum install php-mysqlnd安装它时,出现错误:

When I tried installing it with yum install php-mysqlnd I get an error:

---> Package php-mysqlnd.x86_64 0:5.3.17-1.26.amzn1 will be installed
--> Processing Conflict: php-mysql-5.3.17-1.26.amzn1.x86_64 conflicts php-mysqlnd
--> Finished Dependency Resolution
Error: php-mysql conflicts with php-mysqlnd

推荐答案

./configure命令是源代码编译过程的一部分.

The ./configure command is part of the compilation process from source code.

您可以从源代码进行编译,也可以通过程序包管理器进行安装.我想在您的情况下,包管理器是更可取的.

You can either compile from source or install via package manager. I guess in your case the package manager is preferable.

正如包裹管理员所抱怨的那样,您无法同时安装php-mysqlphp-mysqlnd.

As the package manager complains, you can’t have both php-mysql and php-mysqlnd installed.

所以你可以

yum remove php-mysql

之前

yum install php-mysqlnd

然后通过

php -m | grep mysqlnd

php -i | grep mysqlnd

这篇关于如何为PHP启用mysqlnd?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆