3

I encounter this problem when configure PHP and mysql on my linux box (Fedora 14).

The problem is when I invoke mysqli_connect(), an error issues:

Call to undefined function mysqli_connect().

while call to mysql_connect() works fine.

I install PHP and mysql manually and also turn on the flag --with-mysql when installing PHP. Can't figure out where things go wrong.

3 Answers 3

4

Mysql-i is not Mysql, these are 2 distinct PHP modules and MySQL APIs. Have a look at PHP's documentation regarding the mysqli installation.

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

3 Comments

thanks for your quick reply. So the only solution to my problem is reinstalling PHP?
@Summer_More_More_Tea: Yes. You need to re-do all the steps since ./configure
@Summer_More_More_Tea: Yes, you need an additional configure-parameter for PHP to compile the mysqli extension. According to the PHP docs it should be --with-mysqli=mysqlnd.
3

If yum is an option for you, you can simply run the following to install the mysqli extenstion:

yum install php-mysqli

EDIT: Marc B informs that mysqli is included in the core php rpm on Fedora 14. Simply install php via yum (after removing your manual install) with yum install php

3 Comments

Thank you for the reply. I've followed your advice, but does not work. Maybe I should reinstall the whole PHP.
Fedora 14 doesn't have a seperate mysqli package, it's included in the core php rpm.
Good info, Marc. That means he should just install php itself via yum.
1

http://php.net/manual/en/mysqli.installation.php says:

To use MySQL Native Driver with mysqli you need to configure the PHP source code using the --with-mysqli=mysqlnd option, prior to building PHP.

In other words, --with-mysql is for a different module (which, as you note, works fine).

Comments

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.