Class 'mysqli' not found

Problems with the Windows version of XAMPP, questions, comments, and anything related.

Class 'mysqli' not found

Postby Gruszek » 07. February 2016 23:38

Hello,
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


login.php
<?php
require_once("../scripts/connection.php");
?>


connection.php
<?php
$db = new mysqli("localhost", "root", "", "baza");
?>


What is wrong?
In php.ini i have unmarked:
extension=php_mysql.dll
extension=php_mysqli.dll
Regards.
Gruszek
 
Posts: 2
Joined: 07. February 2016 23:33
Operating System: Windows 10

Re: Class 'mysqli' not found

Postby Altrea » 08. February 2016 03:05

Hi,

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,
Altrea
We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
Altrea
AF Moderator
 
Posts: 11935
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 11 Pro x64

Re: Class 'mysqli' not found

Postby Gruszek » 08. February 2016 06:32

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
Gruszek
 
Posts: 2
Joined: 07. February 2016 23:33
Operating System: Windows 10

Re: Class 'mysqli' not found

Postby bluesky1 » 20. February 2016 15:31

Hi,

i'm using xampp-portable-win32-7.0.2-1-VC14.zip 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.

Regards.
bluesky1
 
Posts: 1
Joined: 20. February 2016 15:22
Operating System: Windows 7 x64


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 103 guests