edo1z blog

プログラミングなどに関するブログです

phpstorm EC2 Xdebugでリモートデバッグ

参考: With a static IP/single developer xDebug remote_connect_back not working for AWS EC2 instance

phpstorm vagrantの仮想マシンをXdebugでデバッグするこれでやってもできない。

xdebug

IDEが1つの場合は、xdebug.remote_hosetを設定して、複数の場合は、xdebug.remote_connect_backに1を設定するようだ。

/etc/php.d/xdebug.ini

; Enable xdebug extension module
zend_extension=/usr/lib64/php/modules/xdebug.so
xdebug.default_enable = 1
xdebug.idekey = "sns"
xdebug.remote_enable = 1
xdebug.remote_port = 9000
xdebug.remote_host = 111.11.111.111(ローカルマシンのIP)
xdebug.remote_log="/tmp/xdebug_remote_log.log"

やってみたが、できなかった。ログがでた。

Log opened at 2014-06-08 19:39:30
I: Connecting to configured address/port: 111.11.111.111:9000.
E: Could not connect to client. :-(
Log closed at 2014-06-08 19:41:38

Setting up port-forwarding resolved this.という情報もある。 9000ポートを自分のmacで空ければいいのかな。 やめよう。