I just need a simple mysqli-Connection invoked from a php-Script. The following script doesn't respond. Would be way easier if some kind of error-message appears, or even some echo-statements for debugging purposes. But no. Only white screen.
<?php
private $db_config_file = realpath(dirname(__FILE__)) . "config/db.ini";
private $db = NULL;
if (!file_exists($this->db_config_file)) {
$msg = "The config-file <code>"
. $this->db_config_file
. "</code> doesnt't exist.";
show_error_page($msg);
}
$config = parse_ini_file($this->db_config_file);
$host = $config[$host];
$user = $config[$user];
$password = $config[$password];
$dbname = $config[$dbname];
$conn = new mysqli($host, $user, $password, $dbname);
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
} else echo "Connection established!";
$conn->close();
?>
The db.ini:
host = localhost
dbname = bl
user = mm
password = noadmin