I keep getting this error when ever i load up my website on windows:
Fatal error: Uncaught Error: Call to undefined function mysqli_connect() in dir\public\config.php:8 Stack trace: #0 {main} thrown in dir\public\config.php on line 8
Ive looked online and tried editing the php.ini (not running apache so dont mention it) with uncommenting the extention= php_mysqli and even extension_dir = "E:\php\ext" but this didnt fix it. Below is my config file:
Config.php:
<?php
define('DB_SERVER', 'localhost');
define('DB_USERNAME', 'root');
define('DB_PASSWORD', 'test');
define('DB_NAME', 'web_mc_login');
/* Attempt to connect to MySQL database */
$link = mysqli_connect(DB_SERVER, DB_USERNAME, DB_PASSWORD, DB_NAME);
// Check connection
if($link === false){
die("ERROR: Could not connect to " . DB_NAME + "Reason: " . mysqli_connect_error());
}
EDIT: Mange to fit by reinstalling php. No clue why though that would fix it