I am trying to set up a LAMP server on lubuntu 14.04.5, I erased index.html and replaced it with :
/var/www/html/index.php
Problem is that everything before this <?php
tag executes and this seems to crash it. I do not know why, is it because I MUST have index.html?
<?php
$dbhost = "localhost:3306";
$dbuser = "user1";
$dbpass = "pass1";
$connection = mysqli_connect($dbhost, $dbuser, $dbpass);
if(!$connection){
die("connection error " . mysqli_error());
}
echo "connected successfully";
mysqli_close($connection);
?>
So in my php error log I get undefined function mysqli_connect(). How do I make this an available function?
When I do aptitude search php5-mysql an i shows up meaning that it is installed. And there are no other mysql modules except for mysqlnd which I don't think I need since its just native directory and mysqlnd-ms How do I resolve this?
edit: I think I need to add the mysqli extension but having trouble locating it.
mysqli_erro()
, should it not bemysqli_error()
?