views:

41

answers:

2

I've installed mySql5 using macports and did manage to run the mysql server. but from some reason all mySql related functions like mysql_connect return an error message saying "a call to undefined function...." under php5.

Here is partial mysqlnd section taken from the phpinfo report:

mysqlnd enabled
Version  mysqlnd 5.0.5-dev - 081106 - $Revision: 289630 $
Command buffer size  4096
Read buffer size  32768
Read timeout  31536000
Collecting statistics  Yes
Collecting memory statistics  Yes

Client statistics 
bytes_sent  0
bytes_received  0
packets_sent  0
packets_received  0
protocol_overhead_in  0
protocol_overhead_out  0
bytes_received_ok_packet  0 

Does anyone know how to solve this issue?

Thanks

+1  A: 

Did you also install php5 with the mysql variant?

sudo port install php5 +mysql or soemthing liek that... i havent installed the php port in awhile. :-)

prodigitalson
No, I've just installed them separately.How can I tell that PHP works properly with mySql?
embedded
take a look at the phpinfo (`php -i` on the comamnd line or drop `<?php phpinfo() ?>` in php file and access it in the browser. It will tell you all the installed extensions. However, for this particular instance if you didnt add the mysql variant when you installd php then i can tell you flat out its not there. you need to reinstal php with the proper variants. you can get a list of avialable variants with `port variant $php` (not sure on the name of the php package youre using so replace $php with that package name)
prodigitalson
Do I need to uninstall PHP first?or I just can install the missing extension?what is the command line for this?
embedded
no mac ports will automatically uninstall/disable the current php installtion and install/activate the new one specified. the command should be something like: `sudo port install $phpPackageName +mysql`. see the manual on installing packages with variants: http://guide.macports.org/#using.variants
prodigitalson
A: 

Problem is solved. You solution did the trick.

embedded