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