By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
458,014 Members | 1,012 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 458,014 IT Pros & Developers. It's quick & easy.

Fatal error: Call to undefined function: mysqli_connect()

P: n/a
i've read various info on the web including the following

http://php.mirrors.ilisys.com.au/man...ref.mysqli.php

mySQL Version 4.1.16
PHP Version 5.1.2
with Zend Engine v2.1.0
OS Windows NT SERVER(2003) 5.2 build 3790

see http://drew.bounceme.net/phpinfo.php for more details

Configuration File (php.ini) Path C:\WINDOWS\php.ini
sql.safe_mode Off-local Off-master

--------------------------------------------------------------------

when trying to load phpmyadmin i get the following
Cannot load mysql extension

when trying to call msqli_connect() i get the following
Fatal error: Call to undefined function: mysqli_connect()

obviously sql functions have not been loaded for php, so as i
understand it i need to load these at run time.

the problem is i cant get it working!

i've tried the folowing in my php.ini file

extension=php_mysql.dll

but i'm not sure if that will work for my version of sql

should i be using the libmySQL.dll file or a call to this file?

i've also tried dl('libmySQL.dll');

Warning: dl() [function.dl]: Invalid library (maybe not a PHP library)
'libmySQL.dll' in in
C:\mahserver\apache\Apache2\htdocs\web\mesne\sql.p hp

and dl('php_mysql.dll');

Warning: dl() [function.dl]: Unable to load dynamic library
'C:\mahserver\PHP\extentions\php_mysql.dll'

i know i'm doing lots of the wrong thing but i also know i'm so close!
can anyone tell me how to properly use 'libmySQL.dll' or if i should be
using someting else???

Feb 4 '06 #1
Share this Question
Share on Google+
1 Reply


P: n/a
you aren't trying this from the command-line are you? The command-line
version disables the MySQL libraries (and many more). until you enable it
as an extension in php.ini.
I've seen this same problem on another post here somewhere, but didn't see
an answer.
One version of libmysql.dll comes with MySQL DB install. and a different
version comes with PHP. One May come with apache. Sounds to me like you
may have a dll version mismatch problem.
have you considered XAMPP http://www.apachefriends.org/en/xampp.html for an
easy install of MySQL/PHP/Apache?
when I installed PHP, it created an ext subdirectory where all the dlls are
located. so your extension= line should look like
extension=ext/php_mysql.dll

libmysql.dll should be in your PATH.
to set your path (your platform may vary from XP), look in the control
panel, performance and maint,system,advanced tab,environment variables.
if you are running PHP as part of a web server, append to the System's PATH.
otherwise, append to the current user's PATH.
If you *are* running into versioning problems, you may have a newer
libmysql.dll provided by MySQL and some package like Apache supplying a
different one.
if all else fails, Try using the MySQL dll (in your PATH hopefully) by
renaming PHP's libmysql.dll to libmysql.dll_ so it won't load and see if you
can run a test db script.
The trick is to get your MySQL clientware >= MySQL Server.

I don't have any great answers because I am using MySQL 5 and it works out
of the box with PHP 5.1.2.
Thanks to your mentioning the extensions= line, someone's earlier post about
disabling of MySQL now seems trivial. duh. why didn't I notice that earlier?

<dr**********@gmail.com> wrote in message
news:11**********************@f14g2000cwb.googlegr oups.com...
i've read various info on the web including the following

http://php.mirrors.ilisys.com.au/man...ref.mysqli.php

mySQL Version 4.1.16
PHP Version 5.1.2
with Zend Engine v2.1.0
OS Windows NT SERVER(2003) 5.2 build 3790

see http://drew.bounceme.net/phpinfo.php for more details

Configuration File (php.ini) Path C:\WINDOWS\php.ini
sql.safe_mode Off-local Off-master

--------------------------------------------------------------------

when trying to load phpmyadmin i get the following
Cannot load mysql extension

when trying to call msqli_connect() i get the following
Fatal error: Call to undefined function: mysqli_connect()

obviously sql functions have not been loaded for php, so as i
understand it i need to load these at run time.

the problem is i cant get it working!

i've tried the folowing in my php.ini file

extension=php_mysql.dll

but i'm not sure if that will work for my version of sql

should i be using the libmySQL.dll file or a call to this file?

i've also tried dl('libmySQL.dll');

Warning: dl() [function.dl]: Invalid library (maybe not a PHP library)
'libmySQL.dll' in in
C:\mahserver\apache\Apache2\htdocs\web\mesne\sql.p hp

and dl('php_mysql.dll');

Warning: dl() [function.dl]: Unable to load dynamic library
'C:\mahserver\PHP\extentions\php_mysql.dll'

i know i'm doing lots of the wrong thing but i also know i'm so close!
can anyone tell me how to properly use 'libmySQL.dll' or if i should be
using someting else???

Feb 9 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.