Skip to content

Commit 95d90be

Browse files
committed
update for app engine flex
1 parent d5f009f commit 95d90be

File tree

2 files changed

+13
-6
lines changed

2 files changed

+13
-6
lines changed

cloud_sql/mysql/pdo/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,14 +65,14 @@ $ php -S localhost:8080
6565

6666
Navigate towards http://localhost:8080 to verify your application is running correctly.
6767

68-
## Google App Engine Standard
69-
70-
To run on GAE-Standard, create an App Engine project by following the setup for these [instructions](https://cloud.google.com/appengine/docs/standard/php7/quickstart#before-you-begin).
68+
To run on App Engine Flex, create an App Engine project by following the setup for these [instructions](https://cloud.google.com/appengine/docs/standard/php7/quickstart#before-you-begin).
7169

7270
First, update `app.yaml` with the correct values to pass the environment variables into the runtime.
7371

72+
Then, make sure that the service account `service-{PROJECT_NUMBER}>@gae-api-prod.google.com.iam.gserviceaccount.com` has the IAM role `Cloud SQL Client`.
73+
7474
Next, the following command will deploy the application to your Google Cloud project:
7575

7676
```bash
77-
$ gcloud app deploy
77+
$ gcloud beta app deploy
7878
```

cloud_sql/mysql/pdo/app.yaml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,24 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
runtime: php72
15+
runtime: php
16+
env: flex
1617

1718
# Remember - storing secrets in plaintext is potentially unsafe. Consider using
1819
# something like https://cloud.google.com/secret-manager/ to help keep secrets
1920
# secret.
2021
env_variables:
21-
CLOUD_SQL_CONNECTION_NAME: ::INSTANCE>
22+
CLOUD_SQL_CONNECTION_NAME: "::DATABASE>"
2223
DB_USER: my-db-user
2324
DB_PASS: my-db-pass
2425
DB_NAME: my-db
2526

27+
beta_settings:
28+
cloud_sql_instances: "::"
29+
30+
runtime_config:
31+
document_root: .
32+
2633
# Defaults to "serve index.php" and "serve public/index.php". Can be used to
2734
# serve a custom PHP front controller (e.g. "serve backend/index.php") or to
2835
# run a long-running PHP script as a worker process (e.g. "php worker.php").

0 commit comments

Comments
 (0)