"Call to undefined function mysqli_connect()" again

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
Hi All,

I know this comes up lots but I have tried the previously posted
solutions and they are not working for me. I have a new installation of
MySQL and PHP running on Windows Server 2003 SP2 with IIS 6. I
installed MySQL 5.0.20 from the installer in mysql-5.0.20-win32.zip at
http://dev.mysql.com/downloads/mysql/5.0.html (and administrator 1.1.9
and query browser 1.1.20). I installed PHP 5.1.2 from the installer
php-5.1.2-installer.exe at http://www.php.net/downloads.php .

The install steps I took for PHP were:
1) Run the installer.
2) Add the installed path (C:\PHP) to the windows path and reboot
3) Unpack the pecl extension, the mysql, and the mysqli dlls into
4) Edit C:\PHP\php.ini to include
   - the reference to doc_root at c:\inetpub\wwwroot
   - the reference to extension_dir at c:\php\ext
   - remove the commenting out of extension=php_mysql.dll
   - add extension=php_mysqli.dll
5) Configure IIS following the instructions for IIS 6 at
6) Copy libmysql.dll from php_5.1.2_mysqli_5.0.18-win32.zip into both
C:\PHP and C:\WINDOWS\system32
7) Restart IIS and the server.

But, when I go to my page I get
the error message:
    Call to undefined function mysqli_connect()

What have I done wrong or failed to do? Does anyone have hints on how I
can diagnose the problem? Judging by the forums and newsgroups it seems
to be a problem that occurs repeatedly, but none of the solutions
suggested before that I have found (e.g. making sure the php.ini file
is correct, adding c:\php to the path, copying libmysql.dll into
C:\WINDOWS\system32, ...) work for me.



PS I wasn't sure where to post this so I've cross-posted it in
nntp://comp.lang.php and in http://forums.mysql.com/ I'll copy any
solution over.

Re: "Call to undefined function mysqli_connect()" again

dumbledad@gmail.com wrote:

Quoted text here. Click to load it

Did you read Fine Manual?

While I always encourage people  to read the newsgroups (via googlegroups  
searching, old deja news) for similar questions, I think the best place to  
start is the official installation manual, as can be found on the PHP  

If you read that, you'll see:
Windows Installer

The Windows PHP installer is available from the downloads page at  
/downloads.php. This installs the CGI version of PHP and for IIS, PWS, and  
Xitami, it configures the web server as well. The installer does not  
include any extra external PHP extensions (php_*.dll) as you'll only find  
those in the Windows Zip Package and PECL downloads.

    Note: While the Windows installer is an easy way to make PHP work, it is  
restricted in many aspects as, for example, the automatic setup of  
extensions is not supported. Use of the installer isn't the preferred  
method for installing PHP.  

The note says that you should not use it if you are planning on extending  
the install, as you just did by adding mysql.

1) Uninstall it,  
2) read the installationmanual at www.php.net
3) Install by hand.

Erwin Moller

Quoted text here. Click to load it

Re: "Call to undefined function mysqli_connect()" again

If you configured the php.ini right it could be a simple error.

there is a function you named mysql (i !!!) and not mysql (without i at
the end)

Re: "Call to undefined function mysqli_connect()" again

langhammer@gmail.com wrote:
Quoted text here. Click to load it

No, mysqli_connect is part of the improved mysql interface and is perfectly  
valid since PHP 4.something.  You just need to ensure the extension is loaded.

Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.

Site Timeline