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