处理冲突:php55w-mysql-5.5.30-2.w6.x86_64冲突php55w-mysqlnd

时间:2015-12-09 10:37:03

标签: php mysql mysqli pdo

php 5.5.30; mysql 5.6.10

我试图执行准备好的声明:

$stmt->execute ();
$result = $stmt->get_result ();

但我明白了:

PHP Fatal error: Call to undefined method mysqli_stmt::get_result()

我知道这个函数需要Mysqlnd - 所以我做了

# yum install php-mysqlnd

但我明白了:

---> Package php55w-mysqlnd.x86_64 0:5.5.30-2.w6 will be installed
--> Processing Conflict: php55w-mysql-5.5.30-2.w6.x86_64 conflicts php55w-mysqlnd
--> Finished Dependency Resolution
Error: php55w-mysql conflicts with php55w-mysqlnd-5.5.30-2.w6.x86_64

供参考:

# yum list installed | grep php
php55w.x86_64                        5.5.30-2.w6                @webtatic       
php55w-cli.x86_64                    5.5.30-2.w6                @webtatic       
php55w-common.x86_64                 5.5.30-2.w6                @webtatic       
php55w-gd.x86_64                     5.5.30-2.w6                @webtatic       
php55w-imap.x86_64                   5.5.30-2.w6                @webtatic       
php55w-mbstring.x86_64               5.5.30-2.w6                @webtatic       
php55w-mysql.x86_64                  5.5.30-2.w6                @webtatic       
php55w-pdo.x86_64                    5.5.30-2.w6                @webtatic       
php55w-xml.x86_64                    5.5.30-2.w6                @webtatic   

如何解决这些问题?我更倾向于使用MySqli而不是PDO

1 个答案:

答案 0 :(得分:1)

-mysql包替换为-mysqlnd

yum remove `php55w-mysql`
yum install `php55w-mysqlnd`