Connection to remote server, using Bitnami & Google Cloud

Problems with the Windows version of XAMPP, questions, comments, and anything related.

Connection to remote server, using Bitnami & Google Cloud

Postby markiecarter » 31. December 2017 14:23

Hello all - I hope you can help.
I have a database and set of php files which I have successfully made work in localhost.
I am trying to deploy these to a remote server, and have followed the steps in the link below:
https://www.apachefriends.org/docs/host ... oogle.html

These are the steps I have completed:
I have registered with Google Cloud platform, and with Bitnami, and I have connected the two accounts.
I have provisioned the Google Cloud platform server, with LAMP, and am running the LampStack in the Cloud.
I have tested mysql and PHP and they work.
I have created the database in the remote server and moved the php files across using FileZilla.

The problem I have is that I cannot connect to the database and successfully query it using mysql.

An example of the code I am using is below, and this is saved as testing_connection.php:

Code: Select all
<?php
echo"<b>MY SITE";

$dbhost = '12.345.67.890'; // this is the URL, and it works successfully to give me access to phpmyadmin, so I know it is correct
$dbuser = 'root';
$dbpass = 'AbcdEFghIJk'; // this is the password I use to get into phpmyadmin
$db = 'pred'; // this is the name of the database

echo"<p>blah blah";

mysql_connect($dbhost,$dbuser, $dbpass) or die ('Unable to connect to database! Please try again later.');
mysql_select_db($db);

echo"<p>Welcome";
$query1 = "select * from user where user_id = 60 ";
echo"<p>This is my website";
$result1 = mysql_query($query1)  or die(mysql_error());
echo"<p>This is your user name:";
$user_name1=mysql_result($result1,0,"username");
echo"<p>$user_name1";


The output I get for 12.345.67.890/testing_connection.php is just the first 2 lines:

MY SITE

blah blah


It seems to not be able to understand the connection details, nor therefore query the db.

Can anyone help with this?

Thanks in advance!

Mark

[EDIT by Altrea: moved to the english section of this board]
markiecarter
 
Posts: 8
Joined: 22. October 2012 13:59
Operating System: Windows XP SP3

Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 97 guests