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