php+xdebug+dbgp remote debugging (multiplayer)

content

  1. Create DBGP service
  2. configure
  3. debugging

Create DBGP service

  1. Go to the download page and download the python version of dbgp to the server.

  2. Execute pydbgpproxy after decompression.

    If prompted that the dbgp module cannot be found, edit the file. There is such a block of code around line 96:

        candidate_paths = [
            dirname(this_dir), # Komodo source tree layout
            join(dirname(this_dir), pythonlib),
        ]

    Change join(dirname(this_dir), pythonlib)to join(this_dir, pythonlib)and execute again.

    If the execution is successful, there will be output similar to the following:

    [root@localhost dbgp]# ./pydbgpproxy -i 0.0.0.0:9001 -d 9000
    INFO: dbgp.proxy: starting proxy listeners.  appid: 11203
    INFO: dbgp.proxy:     dbgp listener on 127.0.0.1:9000
    INFO: dbgp.proxy:     IDE listener on  0.0.0.0:9001

configure

  1. Edit php.ini on the server to
    modify the following two configurations:

    xdebug.remote_host=127.0.0.1
    xdebug.remote_port=9000

    If the Xdebug plugin is not installed, please install it first.

  2. On PHPstorm, set the
    IDE key to any string (it cannot be repeated with others), just fill in your own name in pinyin.
    Host fill in the ip
    Port of the server fill in 9001

    Start listening for debug (you must ensure that monitoring is turned on before the next step, otherwise it will be invalid):

    If the dgbp service is turned on, you can register
    Tools | DBGp Proxy | Register IDE

  3. Configure on the chrome browser
    Enter the chrome store and search for Xdebug helper. After the installation is complete, right-click Xdebug helper and select Options to enter the configuration. IDE key Select Other, and fill in the IDE key just set on PHPstorm on the right. Click Save to save.

If others want to debug too, just follow 2 and 3 configuration.

debugging

Start debugging at the breakpoint~ Refresh the page or click the button to trigger the request, and once there is a line that executes the breakpoint, it will stop.

参考:
Multi-user debugging in PhpStorm with Xdebug and DBGp proxy

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324813755&siteId=291194637