0
votes

I have created laravel application with database it run on localhost so i decide to deploy on GCP appengine but when i click on deploy this happen SQLSTATE[HY000] [2002] Connection timed out i connecting to my GCP sql Instance below are my app.yaml

1st i use local host that uses sql_proxy it show no files directory then i remove the DB_Socket then this error come out SQLSTATE[HY000] [2002] Connection timed out

runtime: php env: flex

runtime_config: document_root: public

Ensure we skip ".env", which is only for local development

skip_files: - .env

env_variables: # Put production environment variables here. APP_LOG: errorlog APP_KEY: base64:G9druqluKMZ6TugSgmM1OJVwWSzfstc08acMRBAqxwg= CACHE_DRIVER: database SESSION_DRIVER: database ## Set these environment variables according to your CloudSQL configuration. DB_HOST: 35.231.242.40 DB_DATABASE: lkcfes DB_USERNAME: root DB_PASSWORD:

1

1 Answers

0
votes

This question is more appropriate for a support case so that a Google Cloud Platform support agent can inspect your app.yaml and Cloud SQL instance.

Having said that, there is a guide here on running Laravel on GAE Flex. You'll find it includes using a "beta_settings" section on your yaml, the Cloud SQL instance's public IP is not used.