Debug Debugging under PHP

Source: Internet
Author: User

Basic knowledge

For PHP, Debug, there is a thing called Xdebug, of course, configure this time, especially in the Mac out a lot of pits, here strongly recommend a Mac similar to phpstudy things, called Mxsrvs, understand?

Xdebug Working principle

1,ide (such as Phpstorm) has integrated a xdebug plug- in that follows BGDP, when it is opened, a local Xdebug debugging service is opened, listening to the port set in the debugger, the default is 9000, This service will listen for all links to Port 9000. In Phpstorm, located in: Toolbars > Run > Start/stop Listening for PHP Xdebug connetions.

2, when the browser sends a request with Xdebug_session_start parameters to the server, the server accepts it to the back end of the PHP processing, if PHP opened the XDEBUG module, The debug information is forwarded to the debug port on the IDE of the client IP. Debugging is not initiated when the parameter or cookie information is not Xdebug_session_start. This provides the possibility for subsequent additions of the switch in the browser. Xdebug's official gives an example diagram: It's good to show the mutual invocation relationship.

This example diagram is bound to the IP, that is, using a fixed IP address, Xdebug.remote_connect_back = 0, is also the default way of Xdebug, in which case Xdebug will read the configuration Xdebug.remote_host when receiving debug notifications and Xdebug.remote_port, the default is localhost:9000, then sends notifications to this port, which is only suitable for single-client development debugging.

Debug Debugging under PHP

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.