i recently installed lamp on ubuntu and now i got problems with them (i think that can not connected to database)
I did the following tests :
- i tested mysql with call phpMyAdmin and that's done :
- i tested php with phpInfo and that's done too :
- i tested simple code for to test the database connection
my simple code this is :
<?php
//phpinfo();
$servername = "localhost";
$username = "root";
$password = "3cret";
// Create connection
$conn = new mysql($servername, $username, $password);
// Check connection
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
echo "Connected successfully";
?>
And the result was:
The localhost page isn’t working
localhost is currently unable to handle this request. 500