はじめに
こんばんは。
今回は前回と同じくGCP系の備忘録です。
本題
まずは app.yaml
ファイルを作成します。
runtime: php74
基本的にこれだけでいいっぽいですが、拡張を入れる場合、同ディレクトリに php.ini
を作成します。
extension=grpc.so [Date] date.timezone= 'Asia/Tokyo'
次に、 public/index.php
を用意します。
<?php phpinfo();
これで、 deploy コマンドを実行してみます。
$ gcloud app deploy --project=XXXXX Initializing App Engine resources...done. Services to deploy: descriptor: [/path/to/example1/app.yaml] source: [/path/to/example1] target project: [XXXXX] target service: [default] target version: [ZZZZZ] target url: [https://xxxxxzzzzz.an.r.appspot.com] target service account: [App Engine default service account] Do you want to continue (Y/n)? Y Beginning deployment of service [default]... ╔════════════════════════════════════════════════════════════╗ ╠═ Uploading 3 files to Google Cloud Storage ═╣ ╚════════════════════════════════════════════════════════════╝ File upload done. Updating service [default]...done. Starting version [XXXXX/default/ZZZZZ] before promoting it. Waiting for operation [apps/XXXXX/operations/aaaa-bbbb-cccc-dddd-eeee] to complete...done. Setting traffic split for service [default]...done. Deployed service [default] to [https://xxxxxzzzzz.an.r.appspot.com] You can stream logs from the command line by running: $ gcloud app logs tail -s default To view your application in the web browser run: $ gcloud app browse
終わりに
かんたんですが以上です。