Php – Fatal error: Class ‘MySQLi’ not found on windows

MySQLmysqliPHP

I installed apache and php and have it up and running (I can access the php.ini via localhost). I'm trying to access mysqli code and cannot find it. The following script indicates mysqli doesn't exist.

if (!function_exists('mysqli_init') && !extension_loaded('mysqli')) {
    echo 'We don\'t have mysqli!!!';
} else {
    echo 'Phew we have it!';
}

I already modified the php.ini file to uncomment extension=php_mysqli.dll as well as the windows extension_dir (extension_dir = "ext")

php is located in c:/php

Best Answer

I had to change the extension_dir = "ext" to "c:/php/ext"

Related Topic