CentOS “Error: php-mysql conflicts with php-mysqlnd” updating with PHP 7.0

Eneko
enekochan
Published in
2 min readApr 1, 2016

If you get an error about a conflict between php-mysql and php-mysqlnd when updating CentOS packages after installing and activating the PHP 7.0 remi package source like this one:

# yum -y install php-mysql

...

--> Finished Dependency Resolution
Error: Package: php-mysql-5.4.45-7.el6.remi.x86_64 (remi)
Requires: php-pdo(x86-64) = 5.4.45-7.el6.remi
Removing: php-pdo-5.3.3-46.el6_7.1.x86_64 (@updates)
php-pdo(x86-64) = 5.3.3-46.el6_7.1
Updated By: php-pdo-7.0.5-1.el6.remi.x86_64 (remi-php70)
php-pdo(x86-64) = 7.0.5-1.el6.remi
Available: php-pdo-5.3.3-40.el6_6.x86_64 (base)
php-pdo(x86-64) = 5.3.3-40.el6_6
Available: php-pdo-5.3.3-46.el6_6.x86_64 (updates)
php-pdo(x86-64) = 5.3.3-46.el6_6
Available: php-pdo-5.4.45-5.el6.remi.x86_64 (remi)
php-pdo(x86-64) = 5.4.45-5.el6.remi
Available: php-pdo-5.4.45-7.el6.remi.x86_64 (remi)
php-pdo(x86-64) = 5.4.45-7.el6.remi
Available: php-pdo-7.0.4-1.el6.remi.x86_64 (remi-php70)
php-pdo(x86-64) = 7.0.4-1.el6.remi
Error: php-mysql conflicts with php-mysqlnd-7.0.5-1.el6.remi.x86_64
Error: Package: php-mysql-5.4.45-5.el6.remi.x86_64 (remi)
Requires: php-pdo(x86-64) = 5.4.45-5.el6.remi
Removing: php-pdo-5.3.3-46.el6_7.1.x86_64 (@updates)
php-pdo(x86-64) = 5.3.3-46.el6_7.1
Updated By: php-pdo-7.0.5-1.el6.remi.x86_64 (remi-php70)
php-pdo(x86-64) = 7.0.5-1.el6.remi
Available: php-pdo-5.3.3-40.el6_6.x86_64 (base)
php-pdo(x86-64) = 5.3.3-40.el6_6
Available: php-pdo-5.3.3-46.el6_6.x86_64 (updates)
php-pdo(x86-64) = 5.3.3-46.el6_6
Available: php-pdo-5.4.45-5.el6.remi.x86_64 (remi)
php-pdo(x86-64) = 5.4.45-5.el6.remi
Available: php-pdo-5.4.45-7.el6.remi.x86_64 (remi)
php-pdo(x86-64) = 5.4.45-7.el6.remi
Available: php-pdo-7.0.4-1.el6.remi.x86_64 (remi-php70)
php-pdo(x86-64) = 7.0.4-1.el6.remi
You could try using --skip-broken to work around the problem
You could try running: rpm -Va --nofiles --nodigest

You can just remove the PHP 5.x version of php-mysql:

# yum remove php-mysql

Update all the packages:

# yum -y update

And finally just install php-mysql again but this time it will be from PHP 7.0:

# yum -y install php-mysql

--

--