using mysqli_connect in PHP5 under windows

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
davidklonski
Forum Contributor
Posts: 128
Joined: Mon Mar 22, 2004 4:55 pm

using mysqli_connect in PHP5 under windows

Post by davidklonski »

Hello

I am trying to use mysqli_connect with PHP5 under windows.
I am getting the following error:
PHP Fatal error: Call to undefined function mysqli_connect()
However I cannot find any extension in php.ini for mysqli_connect to work.

what do I need to configure in php for it to work?
User avatar
markl999
DevNet Resident
Posts: 1972
Joined: Thu Oct 16, 2003 5:49 pm
Location: Manchester (UK)

Post by markl999 »

Should just need to add/uncomment extension=php_mysqli.dll
There should be a /path/to/php5/ext/php_mysqli.dll
davidklonski
Forum Contributor
Posts: 128
Joined: Mon Mar 22, 2004 4:55 pm

Post by davidklonski »

there is no such extension in my php.ini file...
User avatar
markl999
DevNet Resident
Posts: 1972
Joined: Thu Oct 16, 2003 5:49 pm
Location: Manchester (UK)

Post by markl999 »

Weird, there is in the one i just downloaded, the zip package from http://www.php.net/get/php-5.0.0RC3-Win ... m/a/mirror
davidklonski
Forum Contributor
Posts: 128
Joined: Mon Mar 22, 2004 4:55 pm

Post by davidklonski »

To install the mysqli extension for PHP, use the --with-mysqli=mysql_config_path/mysql_config configuration option where mysql_config_path represents the location of the mysql_config program that comes with MySQL versions greater than 4.1.
So far everytime I needed a new module in PHP, all I had to do was to uncomment the necessary extension in php.ini and restart the web server.
I don't know what it means to use the --with-mysqli=mysql_config_path/mysql_config configuration option
What is with-mysqli? and where do I set it?
can anyone help a newbie here?
redmonkey
Forum Regular
Posts: 836
Joined: Thu Dec 18, 2003 3:58 pm

Post by redmonkey »

That quote is for compiling PHP with MySQLi support built in (something I'm guessing you are not trying to do).

Simply add the extension line to the end of your existing extensions in your php.ini file e.g.

Code: Select all

extension=php_mysqli.dll
You will also need to copy/move the 'libmysqli.dll' from the root of the PHP5 installation directory to some directory in your PATH (most likely /WINNT/System32 or /WINNT).
Post Reply