LoginSignup
12
12

More than 5 years have passed since last update.

PhpStormでGoogle App Engine for PHP開発

Last updated at Posted at 2015-03-27

PhpStormでGoogle App Engine for PHPの開発環境を構築します。内容は下記の公式ページをベースにしていますが、ここではWindows環境での解説を行います。
Getting Started with PhpStorm as Google App Engine PHP IDE - PhpStorm - Confluence

1.事前確認

すでにGoogle App Engine LauncherやPythonがインストールされ、使用できている状態を前提としています。初めて開発を行う場合はGoogle App Engine SDK for PHPとPython version 2.7をインストールします。PhpStormは下記のリンクからダウンロードしてください。

PHP IDE :: JetBrains PhpStorm

30日間は無料で試用できます。解説時のPhpStormのバージョンは8.0.3でした。インストーラーの指示に従ってインストールを完了させ、PhpStormを起動します。

2.プロジェクトの作成

PhpStorm8.0.3ではGoogle App Engine Support for PHPプラグインがすでにインストールされているため、すぐにプロジェクトの作成から入ります。Quick Start画面が表示されたら[Create New Project]を選択します。
quick_start.jpg

Project nameとLocationに任意の値を入れてProject typeをプルダウンメニューから[App Engine Project]を選択します。
create_new_project.jpg

App Engine Projectの画面では以下のように入力します。
app_engine_project.jpg

  • Application ID:Application Overviewで作成したアプリケーションID
  • SDK directory:C:\Program Files (x86)\Google\google_appengine
  • Python executable:Pythonの実行ファイルのパス(ex. C:\Python27\python.exe)

[OK]を押すとプロジェクトツリーにファイルが追加されます。
project_tree.jpg

3.プロジェクトの設定

メニューの[File] > [Settings]から設定画面を表示させ、左側メニューから[Languages & Frameworks] > [PHP] > [Google App Engine]を選択します。
settings.jpg

App Engine Account Settingsの[Log in with email and password]にチェックを入れ、Google App Engineを使用しているGoogleアカウントのアドレスとパスワードを入力します。このアカウントでデプロイが行われます。

4.実行

ローカル環境で実行するにはメニューの[Run] > [Run]もしくはツールバーのRunボタンをクリックします。初回実行時にはEdit configuration画面が表示されるため以下の値を入力します。
edit_configuration.jpg

  • Path to php-cgi executable:php-cgi.exeのパス(ex. C:\Program Files (x86)\Google\google_appengine\php\php-5.5-Win32-VC11-x86\php-cgi.exe)
  • Interpreter options:--skip_sdk_update_check=yes

[Run]を押してブラウザのURL欄にローカルホストの値(ex.localhost:8080)等を入力して実行されているか確認します。

5.デプロイ

ローカル環境で動作確認ができたら次にGoogle App Engineへデプロイします。メニューの[Tools] > [Google App Engine for PHP] > [Upload App Engine PHP app...]をクリックするとデプロイが始まります。デプロイが成功したらApplication Overviewの[Running]をクリックして動作確認を行います。

それではよいGAE for PHPライフを!

12
12
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
12
12