i am trying to deploy a test php project on google app engine flexible environment.
My app.yaml looks like this:
*
runtime: php
env: flex
service: testphpflex
manual_scaling:
instances: 1
#[START cloudsql_settings]
# Use the connection name obtained when configuring your Cloud SQL instance.
beta_settings:
cloud_sql_instances: "my-first-project:us-central1:tempdb"
#[END cloudsql_settings]
*
The composer.json looks like this:
{
"require": {
"silex/silex": "^1.3",
"php": "5.6.*",
"google/apiclient": "^2.0"
},
"require-dev": {
"google/cloud-tools": "^0.6",
"paragonie/random_compat": "^2.0",
"phpunit/phpunit": "~4"
}
}
And my sample code looks like this:
<?php
$conn = mysql_connect('unix_socket:/cloudsql/my-first-project:us-central1:tempdb',
'username',
'password'
);
echo "<br><br/>connection done";
if(!$conn)
{
die('Connection Failed'.mysql_error());
}
else
{
die('Connection successful');
}
?>
However, i am not able to connect. What is wrong?