Scale up as you grow — whether you're running one virtual machine or ten thousand.

From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.

I’ve been stuck for several days now and I’m hoping someone can point me in the right direction. When I signed up for a droplet, I received an IP address. I SSH into that IP address, and once there I have installed nginx, php, and mysql without any issues. I’ve gone into mysql, created users, granted them privileges, flushed the privileges, etc. I can do the whole php.ini file thing and see the results in my browser. I have also created a small website (at /var/www/mywebsite) that has several php pages that I can access from my browser. The problem occurs when I go to a page on my website that has:
<php require_once(‘MY_private_database\db_connect.php’); ?>
The file db_connect.php has the following code in it:
<?php
$servername = “localhost”; $username = “myusername”; $password = “mypassword”; $dbname = “mydb”;
// Create connection $conn = mysqli_connect($servername, $username, $password, $dbname); // Check connection if (!$conn) { die("Connection failed: " . mysqli_connect_error()); }
?>
I am able to access MySQL from the command line using myusername and mypassword.
When I’m in my browser, and I go to the page that has the ‘require_once’ in it, I get a 500 error “This page isn’t working. {my ip address} is currently unable to handle this request.” I really need to be able to access my MySQL database from my website. Any suggestions on how I can fix this problem? Thank you.
hbarnard
keneucker
keneucker
rich
santoshpatil
Aspiresoftserv
Yakin
Thejaswini-Rao-U
775c69c916d345a7a367d867078ccb
mayricoak
ndam
bc2f52583874402a988f587c00195d