Not much to say, directly on step by step:
Check out my version of XAMPP:
Modify the configuration file, open Open, and add, the result is as follows (the current need to restart Apache, the configuration will take effect):
Zend_extension = "C:\xampp\php\ext\php_xdebug.dll"
Xdebug.profiler_append = 0
xdebug.profiler_enable = 1
Xdebug.profiler_enable_trigger = 0
Xdebug.profiler_output_dir = "C:\xampp\tmp"
Xdebug.profiler_output_name = "cachegrind.out.%t-%s"
Xdebug.remote_enable = On
Xdebug.remote_handler = "DBGP"
Xdebug.remote_host = "localhost"
Xdebug.remote_mode = "req"
Xdebug.remote_port = 9001
Xdebug.trace_output_dir = "C:\xampp\tmp"
Please pay attention to the port, sometimes this port will conflict (such as the default port 9000, my machine on the conflict), if the conflict, modify one, as long as the settings are consistent with the few parties, no problem
2.chrome Browser settings
Go to Chrome extensions: chrome://extensions/
Click get more extensions, search in Google Store: Jetbrain, then install the JetBrains IDE support plugin!
Of course, there is more to say, Google's expansion store may not be able to access China, if you encounter this situation, you have two choices: one is the domestic download this plugin, self-installation, and there is FQ. I have adopted a second option. (as a programmer, prepare a FQ account or not)
After the installation is successful, the JB flag appears:
Settings for 3.phostorm:
file->setting->languages&frameworks->php, set the interpreter, set as follows:
If the above is not set up, then please click on the following interpreter ... button to enter the settings interface, as long as the correct settings of the PHP directory, and php.ini file settings are correct, the system will automatically detect the start of the Xdebug, as shown in:
Then set file->setting->languages&frameworks->php->servers, set such as:
Then set File->setting->languages&frameworks->php->debug, main set Xdebug port, I'm here 9001, To be consistent with the php.ini inside, as shown:
Finally set FILE->SETTING->LANGUAGES&FRAMEWORKS->PHP->DEBUG->DBGP Proxy,id key and port to be consistent with php.ini, as shown in:
4.phpstorm Debug Configuration settings:
Settings: Run->edit configurations, click Add button (plus), select PHP WEB application type, fill in the relevant information on the right, note that the start URL should point to your project's browser to access the root directory, as shown in:
Here, all the settings are complete, below to see how to use:
5. Start debugging
First open your PHP project, click on the left side of the program statement you want to debug, set a breakpoint, and the breakpoint appears as a light red dot, as shown in:
After you set the breakpoint, you can perform Run->debug->localhost debugging. Or, click the Green Debug icon in the upper-right corner or press the SHIFT+F9 shortcut key.
Some tutorials say you have to click on the top right corner of the phone icon (listening to the PHP debug connection), after my experiment, in fact, do not have to click can be debugged.
After you click Debug, the browser will automatically open the root directory of your current project, and then you can work in the browser, as long as the program executes to the breakpoint location, it will automatically break in the Phpstorm, and the Debug window appears, display debugging environment and variables, and then you could step through.
Open the Run menu, there will be a variety of debugging commands, this is not detailed to say.
For example, my program runs to a breakpoint displayed as follows:
To continue execution, the value needs to be pressed F9, and the browser will appear running results.
Hope this tutorial can help you!
phpStorm9.0 +xampp+chrome PHP Debug Environment Configuration!