Error: "Call to undefined function mysqli_init"

2

I'm doing a test with the codeigniter framework 3.1.5 and trying to connect to the database it has the following error:

Fatal error: Call to undefined function mysqli_init ()

The complete error description:

Fatal error: Call to undefined function mysqli_init ()

in C: \ vm \ system \ database \ drivers \ mysqli \ mysqli_driver.php on line 135

A PHP Error was encountered Severity: Error

Message: Call to undefined function mysqli_init ()

Filename: mysqli / mysqli_driver.php

Line Number: 135

Backtrace:

I really want to know where I'm going wrong! My scenario is very simple:

  • Windows 10 Enterprise
  • PHP 5.6.1 installed
  • Using the built-in PHP server php -S localhost:8080
  • MySQL installed on version 5.7.18 port 3309

The CI configuration code databese:

    active_group = 'default';
    $query_builder = TRUE;

    $db['default'] = array(
   'dsn'    => '',
   'hostname' => 'localhost',
   'username' => 'root',
   'password' => 'root',
   'database' => 'blog',
   'dbdriver' => 'mysqli',
   'dbprefix' => '',
   'pconnect' => TRUE,
   'db_debug' => (ENVIRONMENT !== 'production'),
   'cache_on' => FALSE,
   'cachedir' => '',
   'char_set' => 'utf8',
   'dbcollat' => 'utf8_general_ci',
   'swap_pre' => '',
   'encrypt' => FALSE,
   'compress' => FALSE,
   'stricton' => FALSE,
   'failover' => array(),
   'save_queries' => TRUE,
   'port'=>'3309'
     );

I want to know what's wrong there?

    
asked by anonymous 14.08.2017 / 13:06

1 answer

3

This is not an error in your application.

Probably failing the msqli driver in php In your php.ini and uncomment the following:

extension=php_mysqli.dll

If this extension is enabled and displays the error:     Could not find module for this extension

;Directory in which the loadable extensions (modules) reside.
;http://php.net/extension-dir
;extension_dir = "./"
;On windows:
extension_dir = "C://php//ext"

In Windows the path should always have // ex: extension_dir

Note: the comment is represented by the semicolon (";")

    
14.08.2017 / 13:23