Just got it to work now: 

> I was not using environment variables as shown in the tutorials. I changed 
> the code to follow their guidelines, but still, could not get it to connect 
> to Cloud SQL.

Turned out that the problem was ridiculously simple. In app.yaml, the 
env_variables were missing the quotes...

Looks like PHP was parsing the DSN as a folder or file, because of the '\'

So this:


env: flex
runtime: php
runtime_config:
document_root: .
env_variables:
# Replace USER, PASSWORD, DATABASE, and CONNECTION_NAME with the
# values obtained when configuring your Cloud SQL instance.
MYSQL_USER: user
MYSQL_PASSWORD: password
MYSQL_DSN: mysql:dbname=db_scope;unix_socket=/cloudsql/xxxx
# Use the connection name obtained when configuring your Cloud SQL instance.
beta_settings:
cloud_sql_instances: xxxxx

Changed to this:

env: flex
runtime: php
runtime_config:
document_root: .
env_variables:
# Replace USER, PASSWORD, DATABASE, and CONNECTION_NAME with the
# values obtained when configuring your Cloud SQL instance.
MYSQL_USER: 'user'
MYSQL_PASSWORD: 'password'
MYSQL_DSN: 'mysql:dbname=DBNAME;unix_socket=/cloudsql/xxxxxx'
# Use the connection name obtained when configuring your Cloud SQL instance.
beta_settings:
cloud_sql_instances: 'xxxxxxx'

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-appengine+unsubscr...@googlegroups.com.
To post to this group, send email to google-appengine@googlegroups.com.
Visit this group at https://groups.google.com/group/google-appengine.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-appengine/64554022-af54-4eb0-ae59-a860e75e2995%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to