Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
586 views
in Technique[技术] by (71.8m points)

php - install both mysql and mysqlnd on ubuntu 12.04

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

But on the server: Ubuntu 12.04 PHP: 5.3.10

with mysql, mysqli and pdo mysql

I require mysqlnd to run my app. If i try

apt-get install php5-mysqlnd

it is giving error:

The following packages will be REMOVED:
php5-mysql
The following NEW packages will be installed:
php5-mysqlnd

If I install it, my app code breaks as it uses many mysqli commands.

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.

Please guide.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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

You can find the location of your php.ini in the output of phpinfo().

Also note you'll need to restart your webserver for these changes to take effect.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...