Enabling mysqli in a xampp lite install

I’ve installed xampp lite and need to enable the mysqli extension in PHP 5. This install has all the requirements (PHP 5.0.4, Apache 2.0.54, MySQL 4.1.13) needed, and php_mysqli.dll is in the php/ext/ directory.

Someone told me to do the following to enable it but it doesn’t seem to enable the extension :

  • check that extension_dir in php.ini points to the /ext dir in PHP, this is ok.
  • add a extension=php_mysqli.dll in php.ini
  • restart the server

Any help on why it still doesn’t work? Must I do a recompile of PHP? I hope not since I’ve never done it before… :wink: Thanks!

Are you getting any sort of error or anything? Does it say anything when you restart?

Try restarting rom the command line:

net stop apache2
net start apache2

(assuming xampp lite installed these as services)

Well, I’m testing some code which has the PHP 5 __autoload function. So, when the DB abstraction layer that uses mysqli tries to use those mysqli statements, __autoload kicks in and tries to load mysqli as an include (it appends .inc to the library it can’t find) and it can’t find it :

<code>
function __autoload($classname) {
include_once(str_replace(“_”,“/”,$classname).“.inc”);
//There should be a log file for calls to this method.
}
</code>

The messages I get are :

Warning: __autoload(mysqli.inc) [function.–autoload]: failed to open stream: No such file or directory in …

Warning: __autoload() [function.include]: Failed opening ‘mysqli.inc’ for inclusion (include_path=‘.;C:\xampplite\php\pear\’) in …

and also

Fatal error: Class ‘mysqli’ not found in C:\xampplite\htdocs\inc\DBI\Mysql.inc on line 72

Thanks for any help! Btw, I’ve installed Xampp on WinXP Pro.

Stupid, stupid thing… as it always is it seems. :wink: When installing Xampp, it doesn’t use the php.ini under the /php directory but instead uses the one under /apache/bin/. Grrrrrrr! Well, it’s solved and mysqli works fine. I also had to enable mcrypt manually and it was as easy. Now back to work for me!