LoginSignup
4
4

More than 5 years have passed since last update.

【PHP】homebrewで入れたphp,xdebugをIntelliJでデバッグする【IntelliJ】

Last updated at Posted at 2014-02-09

phpはv5.5です。IntelliJはUltimate、v12の最新です。PhpStormでも同様だと思います。
php、xdebugいずれもhomebrewでインストールしました。
インストール方法は割愛

xdebug

xdebugの設定は下記に変更。

/usr/local/etc/php/5.5/conf.d/ext-xdebug.ini


[xdebug]
zend_extension="/usr/local/Cellar/php55-xdebug/2.2.3/xdebug.so"
xdebug.remote_port=9500
xdebug.remote_enable=true
xdebug.profiler_enable=true
xdebug.remote_autostart=true
xdebug.remote_connect_back=true

リモートポートはデフォルトでは9000です。
ほかとバッティングしたので、9500に変更しています。

IntelliJ

Preferences -> PHP -> Debug

Xdebugのところで、Debug portを、9500に変更します。

デバッグ実行

IntelliJの虫のアイコンの右隣に2つ目(わかりづらくてすみません)、
電話みたいなアイコンがあるので、それを押す。
ソースコードにブレークポイントを設定して、ブラウザから叩いた時に止まればOK。

4
4
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
4
4