First, configure Xdebug
Configure Xdebug related parameters, add the following configuration in the php.ini file, if not installed, refer to the PHP installation Xdebug extension:
[Xdebug]
xdebug.remote_enable = on
Xdebug.remote_handler = dbgp
xdebug.remote_mode = req
Xdebug.remote_host = localhost
xdebug.remote_port = 9000
Xdebug.idekey = Phpstorm
Restart Apache to see if the configuration is active. Second, configure Phpstorm
1. Configuration Servers, the main configuration items are as follows:
Mac path: Phpstorm->preferences->languages & Frameworks->php->servers
Win path is: File->settings->languages & frameworks->php->servers
2. Configure debug to ensure that the debug port corresponds to the above, other options by default:
Mac path: Phpstorm->preferences->languages & Frameworks->php->debug
Win path is: File->settings->languages & Frameworks->php->debug
Third, configure XDebug helper
1. Search and install the XDebug Helper extension in Chrome.
2. After the installation is successful, locate the XDebug helper in the Chrome Extender list and click the option to select the IDE key option as Phpstorm. Four, use Phpstorm + Xdebug to implement breakpoint debugging
1. In the phpstorm to open Debug monitoring, click on the top right corner of the icon like a telephone, the icon green to indicate success;
2. Open the XDebug helper plugin in Chrome:
3. Set breakpoints in Phpstorm, click in front of the line of code that requires breakpoint debugging;
4. Access to the browser for breakpoint debugging, after success we will be able to see the following debugging information:
This article starts in Mayanlong personal blog, Welcome to share, reprint please indicate the source.
Mayanlong Personal Blog: http://www.mayanlong.com
Mayanlong Personal microblog: Http://weibo.com/imayanlong
Mayanlong GitHub Homepage: https://github.com/yanlongma