php enable mysqlnd,如何為php啟用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).

我已經安裝並運行了PHP(版本:5.3.17),我想切換到mysqlnd(在phpinfo mysqlnd中根本不存在)。

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

我讀到,為了設置它,您需要更新。/configure命令:

./configure --with-mysql=mysqlnd \

--with-mysqli=mysqlnd \

--with-pdo-mysql=mysqlnd \

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

當我嘗試安裝它與yum安裝php-mysqlnd時,我得到一個錯誤:

---> 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

5 个解决方案

#1

51

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

./configure命令是源代碼編譯過程的一部分。

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

您可以從源代碼編譯,也可以通過包管理器安裝。我想就你的情況來說,最好是由包裝經理來安排。

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

正如包管理器所抱怨的,您不能同時安裝php-mysql和php-mysqlnd。

So you can

所以你可以

yum remove php-mysql

before

之前

yum install php-mysqlnd

Then check for success via

然后通過

php -m | grep mysqlnd

or

php -i | grep mysqlnd

#2

3

yum install php-mysqlnd is only available on CentALT and maybe remi repos. Webtatic also has some good php repos as well. It is NOT on the default ones (I was using CentOS).

yum install php-mysqlnd僅在CentALT和remi repos上可用。Webtatic也有一些很好的php repos。它不是默認的(我使用CentOS)。

#3

0

Don't know if i understand you right.... Simply download the source of php (php-5.x.x.tar.gz), unzip the source and change to that directory then

不知道我理解你....只需下載php的源代碼(php-5.x.x.tar.gz),然后解壓縮源代碼並更改為該目錄

bash:/dir/of/your/source # ./configure --with-mysql=... and your other config params

after that just make it by

在那之后,你就走吧

bash:/dir/of/your/source # sudo make && make install

#4

0

As of PHP 5.4, the mysqlnd library is a php.net compile time default to all PHP MySQL extensions. - Ref: dev.mysql.com

從PHP 5.4開始,mysqlnd庫是PHP MySQL擴展默認的PHP .net編譯時間。- Ref:dev.mysql.com

it would be a little easier to use XAMPP for Linux 1.8.1(it comes with PHP 5.4.7) then compiling from source.

在Linux 1.8.1(它附帶了PHP 5.4.7)中使用XAMPP,然后從源代碼進行編譯會更容易一些。

#5

-2

yum swap php-mysql php-mysqlnd

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值