How to enable mysqlnd for php?

雨燕双飞 提交于 2019-11-26 20:23:33
Sebastian Keßler

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
iamarobot
yum swap php-mysql php-mysqlnd

yum install php-mysqlnd is only available on CentALT and maybe remi repos. Webtatic also has some good php repos as well. It is NOT on the default ones (I was using CentOS).

I may be late with this but it could be of help to others. As already said elsewhere in the forum, if a call to a function like get_result complains that it is undefined, then php-mysqlnd need to be installed (this question). I realized that doing yum install (centos) will automatically reports that it wants to remove php-mysql and phpmyadmin; do not accept this as your phpmyadmin may not work after. Instead, use yum shell which will take the commands at once and gracefully handle the change over; do these in command line:

# yum shell
> remove  php-mysql
> install php-mysqlnd
> run
> quit

Now you may have to restart both the mariadb (most likely) and the httpd services.

donald123

Don't know if i understand you right.... Simply download the source of php (php-5.x.x.tar.gz), unzip the source and change to that directory then

 bash:/dir/of/your/source # ./configure --with-mysql=... and your other config params

after that just make it by

 bash:/dir/of/your/source # sudo make && make install

As of PHP 5.4, the mysqlnd library is a php.net compile time default to all PHP MySQL extensions. - Ref: dev.mysql.com

it would be a little easier to use XAMPP for Linux 1.8.1(it comes with PHP 5.4.7) then compiling from source.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!