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?
Best Answer
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
:Then proceeded to install with the command:
yum install --enablerepo=remi-php55 php-mysqlnd