What I am doing? I am working on google cloud task queue handler. Queues pushed successfully. Google cloud executed these queue internally. I have created app.yaml file where I have written below lines:-
handlers:
- url: /click_queue
script : click_queue_result.php
Now I opened command line and run this command "gcloud app deploy". Then my project is deployed on google cloud server. Now I try to make a DB connection but continuously showing error db connection timeout.
I want to access Google cloud Sql Instance in click_queue_result.php
Please give me suggestion how I can resolve it??
<?php
$servername = "IP_ADDRESS";
$username = "username";
$password = "password";
// Create connection
$conn = new mysqli($servername, $username, $password);
// Check connection
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
echo "Connected successfully";
?>
When I hit this url https://google-cloud-project-id.appspot.com/click_queue then following error is occurred:-
Connection failed: Connection timed out