Search code examples
phpgoogle-app-enginephp-7app-engine-flexible

Connecting to 2nd gen Cloud SQL on App Engine flexible PHP 7.0 - missing socket


I decided to try out PHP 7 on App Engine and have followed instructions here to connect to second gen Cloud SQL but I'm unable to get it working.

As a testing script I decided to upload PhpMyAdmin and got the following error upon attempting to login:

PhpMyAdmin error

Then I decided to go into debug mode and see what's going on. Turns out that the proxy container is running, the /cloudsql/ folder is created but there is no socket there:

no socket on filesystem

Here is my app.yaml:

runtime: php
env: flex

manual_scaling:
    instances: 1

env_variables:
    CLOUDSQL_UNIX_SOCKET: /cloudsql/project-161108:us-east1:clod-sql-test

beta_settings:
    cloud_sql_instances: "project-161108:us-east1:clod-sql-test"

Here is Cloud SQL instance info (yes, I misspelled cloud when creating it):

Cloud SQL properties

My question is: how can I make the socket appear where it's supposed to be? I've spent 2 days trying to fix this, any advice would be appreciated....


Solution

  • My hypothesis is that the Google Cloud SQL API is not enabled.

    Go to the following link and see if it's enabled. Enable it if not.

    https://console.cloud.google.com/apis/api/sqladmin.googleapis.com/overview?project=_

    Then try re-deploying the app (unfortunately you need to deploy it again).