mysqlnd driver has only one api extension (pdo_mysql)

我的梦境 提交于 2019-12-11 13:53:29

问题


After checking phpinfo() I saw that mysqlnd driver installed on linux (php 5.4) has only one API extension (pdo_mysql), but I also want to be able to work with mysqli.

How do I associate mysqlnd driver with mysqli extension?

I guess I can fix this by reinstalling mysql, but is there any workaround?

Please help! Thank you!


回答1:


Assuming that you did install mysql correctly.

Locate your php.ini by executing phpinfo() or by typing the following command:

php --ini

look for something like "Loaded Configuration File:" and copy the full path of your loaded php configuration file (in my case it is located at: /usr/local/etc/php/5.6/php.ini).

Open php.ini in an editor, for an example:

sudo nano /usr/local/etc/php/5.6/php.ini

Now please add (or make sure it's there) the following line in your php.ini:

extension=mysqli.so

(The extension include line might already be there but commented out - uncomment it in that case)

Save your changes, and then restart apache and mysql:

sudo /etc/init.d/apache2 restart
sudo /etc/init.d/mysql restart

After that all should work fine.

If you are interested in installing mysql (in case it was not installed correctly for an example), please run the following command in your terminal screen:

sudo apt-get install php5-mysql

Good luck!



来源:https://stackoverflow.com/questions/34300384/mysqlnd-driver-has-only-one-api-extension-pdo-mysql

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