LoginSignup
12
14

More than 5 years have passed since last update.

IntelliJですばやくPHP開発環境を構築する

Posted at

前提

Mac OSX 10.11.1
Intellij IDEA ULTIMATE 2016.1.3
PHPプラグインをインストール済

PHPをインストール

brew install php56

※バージョンは適宜読み替えてください

PHPプロジェクト作成

Create New Project -> PHP -> PHP Empty Project
Nextボタンを押す

Screen Shot 2016-07-13 at 17.59.46.png

プロジェクト名を入れる
PHP Langage LevelInterpriterのバージョンとインタプリタを選択する

Screen Shot 2016-07-13 at 18.00.39.png

インタプリタがない場合、ドロップダウンの横のボタンを押すと以下のような画面が出るのでインストールした場所を指定する
OKを押すと先ほどのドロップダウンに候補が追加されているはず

Screen Shot 2016-07-13 at 18.00.24.png

起動設定する

Run -> Edit Configurations
左上の+ボタンを押してPHP Built-in Web Serverを選択

Screen Shot 2016-07-13 at 18.08.36.png

適当な名前をいれる
Portは80だと色々まずいので8000とかに変える
Document rootにプロジェクトのルートを指定してOK
Screen Shot 2016-07-13 at 18.09.41.png

すると右上の実行ボタン横に候補が出る
Screen Shot 2016-07-13 at 18.09.59.png

起動確認する

おもむろに実行ボタンを押すと起動する。
http://localhost:8000/
にアクセス

Screen Shot 2016-07-13 at 18.14.38.png

Not Found
そりゃそうだ。でもなにかが起動している。
ファイルを置いてみる

index.php
<h1>Hello PHP</h1>

もう一度アクセスする

Screen Shot 2016-07-13 at 18.17.22.png

成功。Apacheやらなんやらを入れずに実行できるのはステキ。

以上

12
14
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
14