How to Solve "Fatal Error: Class 'MySQLi' Not Found"

How to solve Fatal error: Class 'MySQLi' not found?

Sounds like you just need to install MySQLi.

If you think you've done that and still have a problem, please post your operating system and anything else that might help diagnose it further.

MySQLi not found error

I got the error corrected by enabling/editing the following config in php.ini:

1st (uncomment and add config):

include_path = "C:\php\includes"

2nd (uncomment):

extension_dir = "ext"

3rd (uncomment and edit config):

extension=D:/PHP/ext/php_mysql.dll
extension=D:/PHP/ext/php_mysqli.dll

PHPUnit, Fatal error: Class 'mysqli' not found

I am not sure if you have configured your php.ini file with the correct path, either DLL or shared object (.so) file. Try running, if you're using Unix/Linux, on your command line,

$> php -i | grep mysqli

and see if it says something being installed, or create a PHP script

<?php phpinfo(); ?>

Run that script and check if it's loaded correctly or not. If you are confident that it was really installed, try checking your php.ini file if it was loaded correctly by checking your "extension" section of php.ini.

Check also when running your PHPUnit, if it's in command line, because it might you have a different path for php.ini vs your php.ini when running in web mode.



Related Topics



Leave a reply



Submit