2

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

Xymanek
  • 1,357
  • 14
  • 25

1 Answers1

4

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

Takashi Matsuo
  • 3,406
  • 16
  • 25
  • 1
    It was actually disabled -.- I expected it to be enabled (similar to how when you go to compute engine it first enables the api). Currently deploying again (for like 30th time :D ) – Xymanek Mar 14 '17 at 16:40
  • 1
    The guide has the button for enabling that API, so if you exactly follow the guide, it should work, but it's easy to miss because there are similar buttons on every past guides. I would miss it too. – Takashi Matsuo Mar 14 '17 at 17:09
  • Hmmm, now the socket file is there but I get the exact same error from PMA.... I will try to redeploy now – Xymanek Mar 14 '17 at 17:39
  • The socket file is there, so it's a progress :) – Takashi Matsuo Mar 14 '17 at 19:25
  • @Xymanek Is it possible for you to invite tmatsuo@google.com to your project so that I can quickly debug the issue? – Takashi Matsuo Mar 14 '17 at 19:25
  • 1
    Turns out that the error is with PhpMyAdmin, using PDO or mySQLi manually works perfectly. I'll see if I can figure out why PMA doesn't find the socket... Thanks for the help! – Xymanek Mar 15 '17 at 09:14
  • Seems like PMA is using mysqli. I think you can specify the default socket in php.ini. php.ini mysqli.default_socket= '/cloudsql/CONNECTION_NAME' – Takashi Matsuo Apr 27 '17 at 03:34