Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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 http://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?

share|improve this question

3 Answers 3

up vote 1 down vote accepted

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

share|improve this answer
1  
Thanks for sharing, you saved me many more hours of search with finding the solution. –  Tom May 21 at 3:34

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.

share|improve this answer
    
Thanks for your suggestion, although this didn't solve things for me. Have update the question with the new error messages. –  John J. Camilleri Dec 13 '13 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 '13 at 15:02

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
share|improve this answer
    
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. –  John J. Camilleri Dec 14 '13 at 13:43

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.