LoginSignup
1
0

More than 5 years have passed since last update.

PhpstormでRemoteDebug

Posted at

仕事の関係で、既存Phpのプロジェクトを維持する必要となったので、PhpStormでRemote Debugの方法を探ってみた。最善ではないとわかりながらも、すぐ忘れるのでとりあえずメモしておく。

環境

  1. host はWindows7 pro (HostにPhp環境なし)
  2. VirtualBox でUbuntu14.4(DefultはPhp5.5.9)

VMに既存システムのプロジェクトを作る

  既存プロジェクトを所定のフォルダにおく、必要ならComposerなどDependencyのパッケージをインストールする。GoalはVMで実行できること。

VMにSSH,SFTPから接続できるようにする

Ubuntu を使っているので、コマンド一つで完了。
sudo apt-get install openssh-server

VMのプロジェクトからローカルプロジェクトを作る

本家のInstruction参照

Remote Interpreter をセットする

本家のInstruction参照

ローカルのソースをRemote(VM)にSyncする

役立った

Remote(VM)にDebug Extensionをインストール

ここ参照

sudo apt-get install php5-xdebug (バージョン注意)
sudo vim /etc/php5/apache2/php.ini (Pathが違うかも)
# Added for xdebug
zend_extension="/usr/lib/php5/20100525/xdebug.so"
xdebug.remote_enable=1
xdebug.remote_handler=dbgp xdebug.remote_mode=req
xdebug.remote_host=127.0.0.1 xdebug.remote_port=9000
sudo service apache2 restart

Fuel Oil をDebugするためには

参考となった
ポイント: OilそのものはPhpですが、PhpStormにその点を認識させる必要

Debug Config

おまけ

これも参考していた
これも

時間があったら、DockerでのDebugも一応やってみたいですが。

1
0
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
1
0