1.- enable Google Cloud SQL API: https://console.cloud.google.com/apis/
2.- get your cloud sql instance name
3.- add the beta_settings to your yaml
beta_settings:
cloud_sql_instances: "here-your-instance-name"
4.- config your doctrine dbal unix_socket
$app->register(new Silex\Provider\DoctrineServiceProvider(), array(
'dbs.options' => array (
'db_conn' => array(
'driver' => 'pdo_mysql',
'unix_socket' => '/cloudsql/here-your-instance-name',
'host' => 'localhost',
'dbname' => 'your-database',
'user' => 'your-user',
'password' => 'your-password',
'charset' => 'utf8',
'collate' => 'utf8_spanish2_ci'
)
)
));