結論:PHP5.5ではphp-mysqlではなくphp-mysqlndを使う。
1. php-mysqlndを使う
最初に、php-mysqlを確認してみる。
yum info php-mysql –enablerepo=remi-php55,remi
versionが5.4系だ。
Available Packages
Name : php-mysql
Arch : x86_64
Version : 5.4.32
Release : 1.el6.remi
Size : 137 k
Repo : remi
Summary : A module for PHP applications that use MySQL databases
URL : http://www.php.net/
License : PHP
Description : The php-mysql package contains a dynamic shared object that will add
: MySQL database support to PHP. MySQL is an object-relational database
: management system. PHP is an HTML-embeddable scripting language. If
: you need MySQL support for PHP applications, you will need to install
: this package and the php package.
Name : php-mysql
Arch : x86_64
Version : 5.4.32
Release : 1.el6.remi
Size : 137 k
Repo : remi
Summary : A module for PHP applications that use MySQL databases
URL : http://www.php.net/
License : PHP
Description : The php-mysql package contains a dynamic shared object that will add
: MySQL database support to PHP. MySQL is an object-relational database
: management system. PHP is an HTML-embeddable scripting language. If
: you need MySQL support for PHP applications, you will need to install
: this package and the php package.
続いて、php-mysqlndを確認してみる。
yum info php-mysqlnd –enablerepo=remi-php55,remi
ちゃんと5.5系が入ってる。
Available Packages
Name : php-mysqlnd
Arch : x86_64
Version : 5.5.16
Release : 1.el6.remi.2
Size : 262 k
Repo : remi-php55
Summary : A module for PHP applications that use MySQL databases
URL : http://www.php.net/
License : PHP
Description : The php-mysqlnd package contains a dynamic shared object that will add
: MySQL database support to PHP. MySQL is an object-relational database
: management system. PHP is an HTML-embeddable scripting language. If
: you need MySQL support for PHP applications, you will need to install
: this package and the php package.
:
: This package use the MySQL Native Driver
Name : php-mysqlnd
Arch : x86_64
Version : 5.5.16
Release : 1.el6.remi.2
Size : 262 k
Repo : remi-php55
Summary : A module for PHP applications that use MySQL databases
URL : http://www.php.net/
License : PHP
Description : The php-mysqlnd package contains a dynamic shared object that will add
: MySQL database support to PHP. MySQL is an object-relational database
: management system. PHP is an HTML-embeddable scripting language. If
: you need MySQL support for PHP applications, you will need to install
: this package and the php package.
:
: This package use the MySQL Native Driver
php-mysqlがバージョンの関係でインストールできないので、php-mysqlndをインストールすることにする。
php-mysqlndはphp-mysqlよりも速いらしい。
sudo yum install php-mysqlnd –enablerepo=remi-php55,remi
設定を反映するため、PHP-FPMとNginxを再起動する。
sudo /etc/rc.d/init.d/php-fpm restart
sudo /etc/init.d/nginx restart
これで繋がるはず。
参考
CentOS6.4にMySQL5.6.12、PHP5.4.17を入れようとしてつまづく » LovePsychedelic
コメント