在Ubuntu 12.04上同时安装mysql和mysqlnd [英] install both mysql and mysqlnd on ubuntu 12.04
问题描述
我在数字海洋中拥有服务器,并试图运行自定义php应用程序.在我的开发机器上: Mac OSX 10.7.5 的PHP:5.3.6 与mysql,mysqli,mysqlnd,pdo mysql
I am having server at digital ocean and trying to run a custom php application. On my development machine: Mac OSX 10.7.5 PHP: 5.3.6 with mysql, mysqli, mysqlnd, pdo mysql
但是在服务器上: Ubuntu 12.04 PHP:5.3.10
But on the server: Ubuntu 12.04 PHP: 5.3.10
使用mysql,mysqli和pdo mysql
with mysql, mysqli and pdo mysql
我需要mysqlnd来运行我的应用程序.如果我尝试
I require mysqlnd to run my app. If i try
apt-get install php5-mysqlnd
出现错误:
The following packages will be REMOVED:
php5-mysql
The following NEW packages will be installed:
php5-mysqlnd
如果安装它,我的应用程序代码将中断,因为它使用了许多mysqli命令.
If I install it, my app code breaks as it uses many mysqli commands.
我搜索并关注了许多关于同一主题的stackoverflow问题,但都徒劳无功. 不过,我还没有尝试过配置选项
I searched and followed many stackoverflow question on same topic but all in vain. Though, I haven't tried configuration option
./configure --with-mysql=mysqlnd \
--with-mysqli=mysqlnd \
--with-pdo-mysql=mysqlnd \
我不知道如何进行此操作,也找不到关于此的教程和文章.
I dont know how to proceed with this and I could not find and tutorials or article on this.
我的开发机器同时具有这两种功能,但服务器却没有.
How My development machine has both but server couldn't.
请指导.
推荐答案
您可能需要启用mysqlnd
扩展名.我最近遇到了这个问题(在安装php5-mysqlnd
之后,所有引用mysqli
都被破坏了),并通过在php.ini的底部添加以下行来修复了该问题:
You probably need to enable the mysqlnd
extension. I ran into this problem recently (all references mysqli
were broken after installing php5-mysqlnd
), and fixed it by adding the following line to the bottom of my php.ini:
extension=mysqlnd.so
您可以在 phpinfo()<的输出中找到php.ini的位置.
还请注意,您需要重新启动网络服务器才能使这些更改生效.
Also note you'll need to restart your webserver for these changes to take effect.
这篇关于在Ubuntu 12.04上同时安装mysql和mysqlnd的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!