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

查看:59
本文介绍了如何为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天全站免登陆