Xdebug breakpoint debugging principle, xdebug breakpoint debugging

Source: Internet
Author: User

Xdebug breakpoint debugging principle, xdebug breakpoint debugging

When Xdebug is used for remote debugging, PHPSTORM and other IDE will listen to the debugging ip address and port set by Xdebug (configured in php. ini)

[xdebug]; Xdebugzend_extension=php_xdebug.dllxdebug.remote_enable = Onxdebug.remote_host = 127.0.0.1xdebug.remote_port = 9000xdebug.idekey="PHPSTORM"

The following figure shows how phpstorm enables listening for php debug connections.

  

After:

AddedXDEBUG_SESSION_STARTThe request parameter. The parameter value is The IDE identifier, which is equivalent to The user name used to distinguish different IDES (xdebug extension in chrome or firefox (The easiest Xdebug is used in firefox) is by setting the cookie method), then send a request to the PHP server, such as: http://www.example.com? XDEBUG_SESSION_START = ECLIPSE_DBGP & KEY = 13986635740313.

The xdebug firefox plug-in shows that the request will contain a cookie:

[In the default configuration, Xdebug can only provide remote debugging services for one client. To provide remote debugging services for multiple clients, you need to setxdebug.remote_connect_back = 1.]

When the client and Xdebug build DBGP (When configuring debug in phpstorm, you must go to file-> settings-> ages & Frameworks-> PHP-> Debug-> DBGp Proxy

  

) After the connection, the client can provide us with the remote debugging service. The process for enabling the remote debugging session is shown in:

If we want to terminate remote debugging, the client will also addXDEBUG_SESSION_STOPOrXDEBUG_SESSION_STOP_NO_EXEC(XDEBUG_SESSION_STOP_NO_EXEC indicates that the script has not been executed.) The parameter is used to send a request to the PHP server. The link is as follows:

http://localhost/index.php?XDEBUG_SESSION_STOP_NO_EXEC=ECLIPSE_DBGP&KEY=13986635740313

When the Xdebug module detects this parameter in the URL, the connection and session with the specified client are terminated.

Reference: http://www.softown.cn/post/117.html

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.