Page 1 of 1

Class 'mysqli' not found

PostPosted: 07. February 2016 23:38
by Gruszek
I have installed XAMPP with PHP 7.0.2 and i get this error:
Fatal error: Uncaught Error: Class 'mysqli' not found in C:\strona\htdocs\scripts\connection.php:2 Stack trace: #0 C:\strona\htdocs\pages\login.php(2): require_once() #1 {main} thrown in C:\strona\htdocs\scripts\connection.php on line 2


$db = new mysqli("localhost", "root", "", "baza");

What is wrong?
In php.ini i have unmarked:

Re: Class 'mysqli' not found

PostPosted: 08. February 2016 03:05
by Altrea

Are you using one of the portable versions?
If yes, it seems that the php.ini configuration of this versions is incomplete.
The extension folder is not set, extensions are not enavled, tmp path is not set, etc.
In the current state i cannot recommend to use the portable versions except you are knowing exactly how to configure php.

best wishes,

Re: Class 'mysqli' not found

PostPosted: 08. February 2016 06:32
by Gruszek
I have installed this: xampp-win32-7.0.2-1-VC14-installer.exe
I try change xampp version and i get the same error.
On version xampp-win32-5.6.15-1-VC11 error looks like this:

Fatal error: Class 'mysqli' not found in C:\strona\htdocs\scripts\connection.php on line 2

Re: Class 'mysqli' not found

PostPosted: 20. February 2016 15:31
by bluesky1

i'm using and i solve this problem modifing php.ini adding path to PEAR folder
include_path = ".;<path to PHP PEAR folder>"

I discover this trick comparing an old php.ini with the new one.
In my opinion, XAMPP portable setup doesn't update php.ini properly.