14

PhpStorm と xdebug を使用して php をデバッグするときに、この問題をよく検索しました。この問題について説明しているリンクが 3 つまたは 4 つ見つかりましたが、どれも役に立ちません。私の Xdebug のバージョンは 2.2.3 で、PhpStorm のバージョンは 6.03 です。これを除いて、すべての行を段階的にデバッグできました

$this->link = mysql_connect($this->dbserver, $this->dbuser, $this->dbpass);

PhpStorm は次のエラーを表示します: ide キー "14841" で着信接続を待機しています。これが私のxdebug構成です:

 zend_extension="/usr/lib/xdebug.so"
 xdebug.remote_autostart=1
 xdebug.show_local_vars=1
 xdebug.dump.GET=*
 xdebug.dump.POST=*
 xdebug.dump.SERVER=*
 xdebug.auto_trace=On
; default trace output directory /tmp
 xdebug.collect_vars = On
 xdebug.trace_output_dir=/tmp
 xdebug.collect_params=4
 xdebug.collect_return=On

 xdebug.profiler_enable=Off
; default trace output directory /tmp
 ;xdebug.profiler_output_dir=/tmp
 ;xdebug.profiler_enable_trigger=On
;test.php?XDEBUG_PROFILE
 xdebug.remote_enable=On
 xdebug.remote_host="localhost"
 xdebug.remote_port=9001
 xdebug.remote_handler="dbgp"
 xdebug.remote_log = "/tmp"
 xdebug.remote_connect_back=1
 xdebug.idekey=PHPStorm  

これらの行「 xdebug.remote_connect_back=1 xdebug.idekey=PHPStorm 」を追加し、これも ide に抵抗しました。3 つのパラメーターが正しいことを保証します。

4

4 に答える 4

6

私の場合、デバッガーが接続されず、Waiting for incoming connection with ide keyメッセージが表示されました。これは、サーバー構成をポート 9000 に設定したためです。これは、ポート 80 (または Web サーバーがリッスンしている他のポート)に設定する必要があります。 Debuggerドロップダウンのすぐ隣にあり、Xdebugポートを設定することだと思ったので、混乱しました。

この値をデバッグポートに設定したくない

デバッグ ポートは、[設定] -> [言語とフレームワーク] -> [PHP] -> [デバッグ] で構成されます。これを 9000 に設定するか、php.ini を設定した値に設定します。

PHPデバッグ設定でデバッグポートを9000に設定します

注意してください、私は IntelliJ IDEA を使用していましたが、それはすべて jetbrains プラットフォームです。

于 2016-02-25T17:27:05.947 に答える