Php

PhpStrom + Firefox + xdebug + postmanデバッグ



Phpstrom Firefox Xdebug Postman Debugging



  1. WindowsにXdebug拡張機能をインストールするには、対応するxdebug.dll拡張機能をダウンロードするだけです。

    • 以下に示すように、独自のPHPバージョンを見つけてください。これがPHP7.2.8です。



      画像

  2. ダウンロードリンク: https://xdebug.org/download.php
    画像 画像



  3. php.iniを構成し、サーバーを再起動します

画像

[xdebug] Zend_extension='F:AppServphp5extphp_xdebug-2.4.1-5.6-vc11.dll' #Specify the absolute path of the Xdebug extension file Xdebug.auto_trace=on #Enable code automatic tracking Xdebug.collect_params=on #Allows collection of parameter variables passed to the function Xdebug.collect_return=on #Allows the return value of the collection function call Xdebug.trace_output_dir='F:AppServXdebug' #Specify the directory where the stack trace file is stored Xdebug.profiler_enable=on # Whether to enable Xdebug performance analysis and create performance information files Xdebug.profiler_output_dir='F:AppServXdebug' #Specify the output directory of the profiling information file Xdebug.remote_enable = on # Whether to enable remote debugging Xdebug.remote_handler = dbgp #Specify the processing protocol for remote debugging Xdebug.remote_host= localhost #Specify the host name for remote debugging Xdebug.remote_port = 9000 #Specify the port number for remote debugging Xdebug.idekey = PHPSTORM #Specify the IDE Key passed to the DBGp debugger handler

二 。 phpStormを開き、ショートカットClt + Alt + Sを開いて、設定検索Xdebugを開きます。
画像



  1. phpStormが上部メニューバー-> PHPでphpバージョンを自動的に認識しない場合は、手動で追加します
    画像2. [設定]> [PHP]> [デバッグ]> [DBGpプロキシ]に移動し、PHPSTORMにIDEキーを入力し、ローカルホストにホストを入力し、9000にポートを入力します

画像3. [設定]> [PHP]> [サーバー]に移動します。ここでは、サーバー側の関連情報を入力する必要があります。たとえば、name fill localhost、host fill localhost、port fill 80、debugger selectXDebugなどです。

画像3。 Firefoxインストール拡張機能Xdebugを開きます

画像ここでポイントテストを破ることができます

XDEBUG_SESSION = PHPSTORMをpostmanリクエストのCOOKIEに追加して、phpstromのデバッグ機能を調整します。

ヘッダーにキーを追加します。 クッキー 、値: XDEBUG_SESSION = PHPSTORM