Local environment Phpstorm10+xdebug Configuration and breakpoint debugging

Source: Internet
Author: User
Local environment Phpstorm+xdebug+chrome Configuration and breakpoint debugging

Installation Environment: Xampp;phpstorm version 10; Windows 7 64bit.

XAMPP, Phpstorm are installed directly in the D packing directory, 9999m directory is built under D:\xampp\htocts, that is, the Directory Project folder path is D:\xampp\htocts\9999m. In Phpstorm>file>open, locate 9999m, click OK, load 9999m to Phpstorm (the installation environment path changes itself as needed, and the configuration content is similar later). Figure 1

1. Start server-side configuration: Install XAMPP, stop Apache Service (note that if you exit XAMPP directly, you will not stop Apache).

2. Locate the php.ini in the installation directory, similar to D:\xampp\php\php.ini, and open it.

3. Find the item that was commented out (remove the previous?) ) and set it as follows:

[XDebug]

============== Original Code

Xdebug.profiler_append = 0
xdebug.profiler_enable = 1
Xdebug.profiler_enable_trigger = 0
Xdebug.profiler_output_dir = "D:\phpStudy\tmp\xdebug"
Xdebug.trace_output_dir = "D:\phpStudy\tmp\xdebug"
Xdebug.profiler_output_name = "cache.out.%t-%s"
xdebug.remote_enable = 1
Xdebug.remote_handler = "DBGP"
Xdebug.remote_host = "127.0.0.1"
; zend_extension= "D:\phpStudy\php53n\ext\xdebug.dll"

============== after the change

Xdebug.profiler_append = 0
xdebug.profiler_enable = 1
Xdebug.profiler_enable_trigger = 0
Xdebug.profiler_output_dir = "D:\phpStudy\tmp\xdebug"
Xdebug.trace_output_dir = "D:\phpStudy\tmp\xdebug"
Xdebug.profiler_output_name = "cache.out.%t-%s"
xdebug.remote_enable = 1
Xdebug.remote_handler = "DBGP"
Xdebug.remote_host = "127.0.0.1"
zend_extension= "D:\phpStudy\php53n\ext\xdebug.dll"
xdebug.idekey= Phpstrom

==================== reproduced in

Zend_extension = "D:\xampp\php\ext\php_xdebug.dll"

Xdebug.profiler_append = 0

xdebug.profiler_enable = 1

Xdebug.profiler_enable_trigger = 0

Xdebug.profiler_output_dir = "D:\xampp\tmp"

Xdebug.profiler_output_name = "cachegrind.out.%t-%s"

Xdebug.remote_enable = On

Xdebug.remote_handler = "DBGP"

Xdebug.remote_host = "127.0.0.1"

Xdebug.trace_output_dir = "D:\xampp\tmp"

xdebug.idekey= Phpstrom

The initial setting is this: Figure 2

The meaning is to be commented out, so first remove;

Then turn on the xdebug.remote_enable = on;

Also to increase xdebug.idekey= phpstrom.

Where Remote_host refers to the debug client's address, that is, the IDE's IP, the same remote_port is the client's port, these two in the case of remote debugging attention to modify, remote when the final change:

[XDebug]

Zend_extension = "D:\xampp\php\ext\php_xdebug.dll"

Xdebug.profiler_append = 0

xdebug.profiler_enable = 1

Xdebug.profiler_enable_trigger = 0

Xdebug.profiler_output_dir = "D:\xampp\tmp"

Xdebug.profiler_output_name = "cachegrind.out.%t-%s"

xdebug.remote_enable = 1

Xdebug.remote_handler = "DBGP"

Xdebug.remote_mode = "req"

Xdebug.remote_port = 9000

4. Save the file and restart the Apache check if the Xdebug service has been successfully opened. Figure 3

One way to enter D:\xampp\php\php.exe-m in CMD is to see Xdebug, which indicates the successful opening of Xdebug. Figure 4

Another way to open localhost for the browser, locate Phpinfo () Click Open Configuration, find the Xdebug entry, find the description xdebug the configuration was successful. Figure 5

At this point, the server-side configuration is complete.

5. The following is client-side debugging. Open Phpstorm, enter file>settings>php (file-settings-language and frame-php), here to interpreter Browse, fill in D:\xampp\php\php.exe, automatically identify the version. Figure 6

6. Enter File>settings>php>servers, here to fill out the server side of the relevant information, name fill localhost,host fill localhost,port fill 80,debugger choose Xdebug. Figure 7

7. Go to File>settings>php>debug, see Xdebug tab, Port Fill 9000, other default. Figure 8

8. Enter FILE>SETTINGS>PHP>DEBUG>DBGP proxy,ide key to fill in the Phpstorm,host fill in the Localhost,port 9000, click OK to exit the settings. Figure 9

9. Enter run> Debug configurations, point + number, server optional localhost,start URL fill http://localhost/9999m, Browse to fill Chrome, click OK to exit the settings. Figure 10

Click OK to exit the setup, the Phpstorm is automatically populated with localhost next to the Run button, and the Run button is activated by gray to be green. If the start URL is filled with http://localhost, without filling in 9999m, then when the Phpstorm Run button is clicked, the browser enters the default address http://localhost, no way to directly access http://localhost/9999m. Figure 11

Chrome browser link configuration. Find the corresponding plugin, chrome for phpstrom IDE support CHROME.CRX, download it yourself and drag the file to Chrome Settings > extensions. The Add JB icon in the top right corner of Chrome is the plugin that was successfully installed. Figure 12

11. Open the Monitor in the Phpstorm, is a phone-like button, click into Green, click in the program code point, set the program segment point, click the Green Debug Crawler button, Chrome browser opens Xdebug page, Phpstorm appears the Debug window, And get to the variables value, that is, to see the following debug information, indicating a successful configuration. Figure 13

Reproduced in: http://blog.sina.com.cn/zhyl4669

  • Related Article

    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.