Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to enable mysqlnd for php?

I have PHP installed and running (version: 5.3.17) and I want to switch to mysqlnd (in the phpinfo mysqlnd does not exist at all).

I read that in order to set it, you need to update the ./configure command:

./configure --with-mysql=mysqlnd \ --with-mysqli=mysqlnd \ --with-pdo-mysql=mysqlnd \ 

When I tried installing it with yum install php-mysqlnd I get an error:

---> Package php-mysqlnd.x86_64 0:5.3.17-1.26.amzn1 will be installed --> Processing Conflict: php-mysql-5.3.17-1.26.amzn1.x86_64 conflicts php-mysqlnd --> Finished Dependency Resolution Error: php-mysql conflicts with php-mysqlnd 
like image 622
SimonW Avatar asked Oct 31 '12 13:10

SimonW


People also ask

How do I enable Mysqlnd in CPanel?

By default it must be checked for your hosting ( depends on the version of PHP you are using ) , you can enable or disable this by visiting CPanel and then PHP Version link.

What is Mysqlnd?

The MySQL native driver for PHP (mysqlnd) is a drop-in replacement for the MySQL Client Library (libmysql) for the PHP script language.

Which PHP extension is required for work with MySQL?

Installation ¶ 0, and it was removed in PHP 7.0. 0. Instead, the MySQLi or PDO_MySQL extension should be used. See also MySQL: choosing an API guide.


2 Answers

The ./configure command is part of the compilation process from source code.

You can either compile from source or install via package manager. I guess in your case the package manager is preferable.

As the package manager complains, you can’t have both php-mysql and php-mysqlnd installed.

So you can

yum remove php-mysql 

before

yum install php-mysqlnd 

Then check for success via

php -m | grep mysqlnd 

or

php -i | grep mysqlnd 
like image 180
Sebastian Keßler Avatar answered Sep 22 '22 05:09

Sebastian Keßler


yum swap php-mysql php-mysqlnd 
like image 41
iamarobot Avatar answered Sep 23 '22 05:09

iamarobot