dockerとphpstormを組み合わせてxdebugを取得することができました。http呼び出しの場合... IE
http://192.168.99.100:8081/?XDEBUG_SESSION_START=PHPSTORM
しかし、phpunit
テストを実行しようとすると、phpstormに接続されません
phpstormで正しいディレクトリマッピングを実行し、docker-instanceで次のコマンドを実行しました export XDEBUG_CONFIG="idekey=PHPSTORM"
また、Dockerを試してみました:export PHP_IDE_CONFIG = 'serverName = web.docker'そして、phpstormweb.dockerでサーバー構成に名前を付けました。まだhttpで動作していますが、CLIでは動作していません
では、コマンドラインでもphpstormとxdebugを連携させることはできますか?
これが私のファイルです: /etc/php5/cli/conf.d/20-xdebug.ini
zend_extension=xdebug.so
xdebug.remote_enable=1
xdebug.idekey=PHPSTORM
xdebug.remote_connect_back=1
xdebug.remote_host=172.17.42.1
dxdebug.remote_autostart=1
ロギングをオンにして、取得したxdebug_remote_hostIPアドレスで遊ぶと
W: Remote address not found, connecting to configured address/port: localhost:9000. :-|
E: Could not connect to client. :-(
Log closed at 2015-10-13 12:20:39
Log opened at 2015-10-13 12:22:58
I: Checking remote connect back address.
W: Remote address not found, connecting to configured address/port: 172.17.42.1:9000. :-|
E: Could not connect to client. :-(
Log closed at 2015-10-13 12:22:58
Log opened at 2015-10-13 12:23:58
I: Checking remote connect back address.
W: Remote address not found, connecting to configured address/port: 192.168.99.100:9000. :-|
E: Could not connect to client. :-(
Log closed at 2015-10-13 12:23:58
解決策(編集) xdebugロギングをオンにすることで、接続に成功したことがわかり192.168.99.1
、問題が解決しました。
xdebug.remote_host=192.168.99.1
今、2つのことが頭に浮かびます。
xdebug.remote_hostは正しく設定されていますか?あなたが192.168.
アドレスを提供したHTTPリンクの場合、それは172.17.
アドレスです。そのIPでホストにpingを実行できますか?
あなたのiniファイルには次のように書かれています。
dxdebug.remote_autostart=1
これはここでの単なるタイプミスですか、それとも実際に設定ファイルにありますか?なぜなら、前に「d」を付けずにxdebugを読み取る必要があるからです。そのはず:
xdebug.remote_autostart=1
次のようなスクリプトを実行するときにオプションを追加する場合にのみ、dを追加する必要があります。
php -dxdebug.remote_autostart=1 script.php
それでも問題が解決しない場合は、次のようなものを構成に追加して、リモートログを有効にしてください。
xdebug.remote_log = /var/log/xdebug_remote.log
多分それは問題を見つけるのを助けるでしょう。
この記事はインターネットから収集されたものであり、転載の際にはソースを示してください。
侵害の場合は、連絡してください[email protected]
コメントを追加