2

I have a VPS which came from an image called CentOS 6.4 x64,Nginx,php-fpm,MariaDB. PHP and MariaDB are both installed, but it seems that PHP does not have the MySQL driver installed. I first tried adding

extension=mysql.so

to my php.ini but that gives me the following error:

Starting php-fpm: [12-Dec-2013 17:23:27] NOTICE: PHP message: PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib64/php/modules/mysql.so' - /usr/lib64/php/modules/mysql.so: cannot open shared object file: No such file or directory in Unknown on line 0

I then tried yum install php-mysql but get the following:

Resolving Dependencies
--> Running transaction check
---> Package php-mysql.x86_64 0:5.4.23-1.el6.remi will be installed
--> Processing Dependency: php-pdo(x86-64) = 5.4.23-1.el6.remi for package: php-mysql-5.4.23-1.el6.remi.x86_64
--> Processing Dependency: libmysqlclient.so.18(libmysqlclient_18)(64bit) for package: php-mysql-5.4.23-1.el6.remi.x86_64
Package mysql-libs-5.5.35-1.el6.remi.x86_64 is obsoleted by MariaDB-shared-5.5.32-1.i386 which is already installed
--> Processing Dependency: libmysqlclient.so.18(libmysqlclient_16)(64bit) for package: php-mysql-5.4.23-1.el6.remi.x86_64
Package mysql-libs-5.5.35-1.el6.remi.x86_64 is obsoleted by MariaDB-shared-5.5.32-1.i386 which is already installed
--> Processing Dependency: libmysqlclient.so.18()(64bit) for package: php-mysql-5.4.23-1.el6.remi.x86_64
Package mysql-libs-5.5.35-1.el6.remi.x86_64 is obsoleted by MariaDB-shared-5.5.32-1.i386 which is already installed
--> Finished Dependency Resolution
Error: Package: php-mysql-5.4.23-1.el6.remi.x86_64 (remi)
           Requires: libmysqlclient.so.18()(64bit)
           Available: compat-mysql55-5.5.11-1.el6.remi.x86_64 (remi-test)
               libmysqlclient.so.18()(64bit)
           Available: compat-mysql55-5.5.34-1.el6.remi.x86_64 (remi-test)
               libmysqlclient.so.18()(64bit)
           Available: mysql-libs-5.5.34-1.el6.remi.x86_64 (remi)
               libmysqlclient.so.18()(64bit)
           Available: mysql-libs-5.5.35-1.el6.remi.x86_64 (remi)
               libmysqlclient.so.18()(64bit)
           Available: mysql-libs-5.1.71-1.el6.i686 (base)
               Not found
Error: Package: php-mysql-5.4.23-1.el6.remi.x86_64 (remi)
           Requires: libmysqlclient.so.18(libmysqlclient_16)(64bit)
           Available: compat-mysql55-5.5.11-1.el6.remi.x86_64 (remi-test)
               libmysqlclient.so.18(libmysqlclient_16)(64bit)
           Available: compat-mysql55-5.5.34-1.el6.remi.x86_64 (remi-test)
               libmysqlclient.so.18(libmysqlclient_16)(64bit)
           Available: mysql-libs-5.5.34-1.el6.remi.x86_64 (remi)
               libmysqlclient.so.18(libmysqlclient_16)(64bit)
           Available: mysql-libs-5.5.35-1.el6.remi.x86_64 (remi)
               libmysqlclient.so.18(libmysqlclient_16)(64bit)
           Available: mysql-libs-5.1.71-1.el6.i686 (base)
               Not found
Error: Package: php-mysql-5.4.23-1.el6.remi.x86_64 (remi)
           Requires: libmysqlclient.so.18(libmysqlclient_18)(64bit)
           Available: compat-mysql55-5.5.11-1.el6.remi.x86_64 (remi-test)
               libmysqlclient.so.18(libmysqlclient_18)(64bit)
           Available: compat-mysql55-5.5.34-1.el6.remi.x86_64 (remi-test)
               libmysqlclient.so.18(libmysqlclient_18)(64bit)
           Available: mysql-libs-5.5.34-1.el6.remi.x86_64 (remi)
               libmysqlclient.so.18(libmysqlclient_18)(64bit)
           Available: mysql-libs-5.5.35-1.el6.remi.x86_64 (remi)
               libmysqlclient.so.18(libmysqlclient_18)(64bit)
           Available: mysql-libs-5.1.71-1.el6.i686 (base)
               Not found
Error: Package: php-mysql-5.4.23-1.el6.remi.x86_64 (remi)
           Requires: php-pdo(x86-64) = 5.4.23-1.el6.remi
           Installed: php-pdo-5.5.0-1.el6.remi.x86_64 (@remi-test)
               php-pdo(x86-64) = 5.5.0-1.el6.remi
           Available: php-pdo-5.3.3-26.el6.x86_64 (base)
               php-pdo(x86-64) = 5.3.3-26.el6
           Available: php-pdo-5.3.3-27.el6_5.x86_64 (updates)
               php-pdo(x86-64) = 5.3.3-27.el6_5
           Available: php-pdo-5.4.22-1.el6.remi.x86_64 (remi)
               php-pdo(x86-64) = 5.4.22-1.el6.remi
           Available: php-pdo-5.4.23-1.el6.remi.x86_64 (remi)
               php-pdo(x86-64) = 5.4.23-1.el6.remi
 You could try using --skip-broken to work around the problem
** Found 3 pre-existing rpmdb problem(s), 'yum check' output follows:
2:postfix-2.6.6-2.2.el6_1.x86_64 has missing requires of libmysqlclient.so.16()(64bit)
2:postfix-2.6.6-2.2.el6_1.x86_64 has missing requires of libmysqlclient.so.16(libmysqlclient_16)(64bit)
2:postfix-2.6.6-2.2.el6_1.x86_64 has missing requires of mysql-libs

What should I do? Of course I don't want to install MySQL itself, just the PHP driver.

Note: this is a cross-post from https://stackoverflow.com/questions/20561527/install-php-mysql-to-use-mariadb, but perhaps it is actually better suited here than StackOverflow

Update 1

After John's suggestion, I tried yum install php-mysql --disablerepo=remi. However this still gave me more problems:

Error: Package: php-mysql-5.3.3-27.el6_5.x86_64 (updates)
           Requires: libmysqlclient.so.16(libmysqlclient_16)(64bit)
           Available: mysql-libs-5.1.71-1.el6.x86_64 (base)
               libmysqlclient.so.16(libmysqlclient_16)(64bit)
Error: Package: php-mysql-5.3.3-27.el6_5.x86_64 (updates)
           Requires: libmysqlclient.so.16()(64bit)
           Available: mysql-libs-5.1.71-1.el6.x86_64 (base)
               libmysqlclient.so.16()(64bit)
Error: Package: php-mysql-5.3.3-27.el6_5.x86_64 (updates)
           Requires: php-common(x86-64) = 5.3.3-27.el6_5
           Installed: php-common-5.5.0-1.el6.remi.x86_64 (@remi-test)
               php-common(x86-64) = 5.5.0-1.el6.remi
           Available: php-common-5.3.3-26.el6.x86_64 (base)
               php-common(x86-64) = 5.3.3-26.el6
           Available: php-common-5.3.3-27.el6_5.x86_64 (updates)
               php-common(x86-64) = 5.3.3-27.el6_5

Update 2

If I try yum install php-mysqlnd then the dependency errors are reduced:

Error: Package: php-mysqlnd-5.4.23-1.el6.remi.x86_64 (remi)
           Requires: php-pdo(x86-64) = 5.4.23-1.el6.remi
           Installed: php-pdo-5.5.0-1.el6.remi.x86_64 (@remi-test)
               php-pdo(x86-64) = 5.5.0-1.el6.remi
           Available: php-pdo-5.3.3-26.el6.x86_64 (base)
               php-pdo(x86-64) = 5.3.3-26.el6
           Available: php-pdo-5.3.3-27.el6_5.x86_64 (updates)
               php-pdo(x86-64) = 5.3.3-27.el6_5
           Available: php-pdo-5.4.22-1.el6.remi.x86_64 (remi)
               php-pdo(x86-64) = 5.4.22-1.el6.remi
           Available: php-pdo-5.4.23-1.el6.remi.x86_64 (remi)
               php-pdo(x86-64) = 5.4.23-1.el6.remi

So all I need to find some source for php-mysqlnd 5.5 which apparently is not in available in remi-test. Any ideas where I can find this? I only want this particular package so maybe I should just download it and build from source?

5 Answers 5

4

Well, I finally managed to solve this by adding the remi-php55 repository. In short, I added the following to /etc/yum.repos.d/remi.repo:

[remi-php55]
name=Les RPM de remi de PHP 5.5 pour Enterprise Linux 6 - $basearch
#baseurl=http://rpms.famillecollet.com/enterprise/6/php55/$basearch/
mirrorlist=http://rpms.famillecollet.com/enterprise/6/php55/mirror
# WARNING: If you enable this repository, you must also enable "remi"
enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-remi

[remi-php55-debuginfo]
name=Les RPM de remi de PHP 5.5 pour Enterprise Linux 6 - $basearch - debuginfo
baseurl=http://rpms.famillecollet.com/enterprise/6/debug-php55/$basearch/
enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-remi

Then proceeded to install with the command: yum install --enablerepo=remi-php55 php-mysqlnd

1
  • 1
    Thanks for sharing, you saved me many more hours of search with finding the solution.
    – Tom
    May 21, 2014 at 3:34
1

You installed PHP 5.5 from the remi-test repository, but you don't seem to have this repo enabled anymore. This is why the wrong older version of php-mysql is being proposed for installation. Try enabling the remi-test repo.

yum --enablerepo=remi-test install php-mysql
1
  • Thanks for the reply, but unfortunately this did not work. I got the exact same error message as before, so I guess remi-test is in fact enabled. Dec 14, 2013 at 13:43
0

Looks like some packages from the remi repository are playing hob with your requriements. For this command, try disabling that repo: yum install php-mysql --disablerepo=remi. That should get you the package you need, though you may have other issues with the remi repository in the future.

2
  • Thanks for your suggestion, although this didn't solve things for me. Have update the question with the new error messages. Dec 13, 2013 at 14:55
  • You're also getting issues from installed packages that came from the remi-test repository. Your best bet at this point is to remove all the packages from the remi and remi-test repositories, then install those packages from the base repository. Specifically, php-common from remi-test is too new for the php-mysql package from the base repo.
    – John
    Dec 13, 2013 at 15:02
0

I just found the same problem with my chroot Apache install on the CentOS Linux for the Yii2 project. Seems it just because pdo_mysql.so PHP module expect to open libmysqlclient.so.18 in the /usr/lib64, but acutally mariadb already CONTAIN it in the /usr/lib64/mysql. It's simple to fix so:

# ln -s /usr/lib64/mysql/libmysqlclient.so.18.0.0 /usr/lib64/libmysqlclient.so.18
0

My environment differs a little from yours, as I have faced the problem on CentOS 7, but for Requires: libmysqlclient.so.16(libmysqlclient_16)(64bit) problem it did the trick.

I have installed MariaDB engine from https://downloads.mariadb.org/mariadb/repositories/#mirror=kisiek and my dependency problem has gone.

It didn't require any additional work after installing MariaDB from their official repository.

I cannot provide more verbose answer as my dependency probelem matches only libmysqlclient.so.16(libmysqlclient_16)(64bit) - I was installing different software which complained about it.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .