mysqlnd驱动程序只有一个api扩展(pdo_mysql) [英] mysqlnd driver has only one api extension (pdo_mysql)

查看:258
本文介绍了mysqlnd驱动程序只有一个api扩展(pdo_mysql)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

检查phpinfo()后,我发现在Linux(php 5.4)上安装的 mysqlnd 驱动程序仅具有一个API扩展( pdo_mysql ),但我也希望能够与 mysqli 一起使用.

如何将mysqlnd驱动程序与mysqli扩展名关联?

我想我可以通过重新安装mysql来解决此问题,但是有什么解决方法吗?

请帮助!谢谢!

解决方案

假设您确实正确安装了mysql.

通过执行phpinfo()或键入以下命令来找到您的php.ini:

php --ini

查找类似于已加载的配置文件:"的内容,然后复制已加载的php配置文件的完整路径(在我的情况下,位于:/usr/local/etc/php/5.6/php.ini). /p>

在编辑器中打开php.ini,例如:

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

现在,请在php.ini中添加(或确保它存在)以下行:

extension=mysqli.so

(扩展包含行可能已经存在,但已被注释掉-在这种情况下,请取消注释)

保存更改,然后重新启动apache和mysql:

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

之后,一切应该正常.

如果您对安装mysql感兴趣(以防未正确安装mysql),请在终端屏幕上运行以下命令:

sudo apt-get install php5-mysql

祝你好运!

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!

解决方案

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!

这篇关于mysqlnd驱动程序只有一个api扩展(pdo_mysql)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆