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

跟風遠走 提交于 2019-12-13 16:07:09

问题


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:

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:

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):

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....


回答1:


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).



来源:https://stackoverflow.com/questions/42784800/connecting-to-2nd-gen-cloud-sql-on-app-engine-flexible-php-7-0-missing-socket

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!