LoginSignup
6
5

More than 5 years have passed since last update.

PhpStorm + Xdebugでリモートデバッグ時にデバッグクライアントに繋がらない。

Posted at

事象

PhpStorm + Xdebug でリモートデバッグを行なおうとしたがデバッグクライアントに繋がらない。
リモートデバッグとは言いつつも apache はローカル環境で起動してます。

I: Checking remote connect back address.
I: Checking header 'HTTP_X_FORWARDED_FOR'.
I: Checking header 'REMOTE_ADDR'.
I: Remote address found, connecting to ::1:9001.
E: Could not connect to client. :-(

原因

xdebug.remote_host に localhost や 127.0.0.1 してても ipv6のループバックアドレス(::1)に変換されて接続しに行って拒否られているようだ。

解決方法

php.ini の xdebug セクションに

xdebug.remote_connect_back=0

または

xdebug.remote_connect_back=off

を設定する。
これで繋がった。

もしかしたら hosts に

localhost 127.0.0.1

て書いても行けるかも。

6
5
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
6
5