- Learning Google BigQuery
- Thirukkumaran Haridass Eric Brown
- 333字
- 2021-07-02 21:24:04
Deploying to Google App Engine
To deploy to Google App Engine, use the app command group. The App Engine allows us to host websites developed in PHP, Java, Go, or Python in the standard environment. To deploy a sample app to the App Engine instance that was created in Chapter 1, Google Cloud and Google BigQuery, follow the steps listed here:
- Download the sample PHP file and app.yaml file from the GitHub URL (https://github.com/hthirukkumaran/Learning-Google-BigQuery/tree/master/chapter2/phpapp) to a folder on the local computer. This PHP code connects to the Cloud SQL instance of the same project, executes a sample query, and displays the result.
- Open the index.php file and modify the $dsn variable value to point to your Cloud SQL instance. To get the full qualified Cloud SQL instance name, open the Cloud SQL instance in your project. Copy the value of the instance connection name and paste that value instead of the following value into the PHP file. Change the dbname in the $dsn variable to your database name. Change the values of $username to the database username in Cloud SQL you want to use, and $password to the password of the user specified in the $username variable:
my-first-project-170319:us-central1:trainingdbserver

- Save the changes, open the Terminal, and go to the directory where the app.yaml and index.php are located. Type the following command to deploy your changes to the App Engine instance you created in the previous chapter. If asked for confirmation to deploy press Y:
gcloud app deploy
- Once the app is deployed, type the following command to open the app in the browser and view the screen. If you encounter any errors, you can see the error in the Error Reporting option of the menu:
gcloud app browse
- If you encounter any permission errors while the app is connecting to the Cloud SQL instance, check to make sure that permission is granted for the App Engine to connect to Cloud SQL under the section App Engine authorization, as shown in the following screenshot:

推薦閱讀
- 從零構建知識圖譜:技術、方法與案例
- Cocos2D-X權威指南(第2版)
- Mastering Selenium WebDriver
- 云原生Spring實戰
- 21天學通C++(第6版)
- Java應用開發技術實例教程
- Gradle for Android
- Unity 2D Game Development Cookbook
- PHP從入門到精通(第4版)(軟件開發視頻大講堂)
- Linux Shell核心編程指南
- The Professional ScrumMaster’s Handbook
- Instant PHP Web Scraping
- PHP 7從零基礎到項目實戰
- 軟件體系結構
- Learning Jakarta Struts 1.2: a concise and practical tutorial