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
  • 1
    mysqlnd is not an actual extension exposing an API to php scripts. It's a communication layer used by other extensions like php-mysql, php-mysqli and PDO_MYQSL Commented Feb 3, 2010 at 16:16

1 Answer 1

1

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. :-)

Sign up to request clarification or add additional context in comments.

4 Comments

No, I've just installed them separately. How can I tell that PHP works properly with mySql?
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)
Do I need to uninstall PHP first? or I just can install the missing extension? what is the command line for this?
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: guide.macports.org/#using.variants

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.