Phpstorm Configuring Xdebug Debugging

Source: Internet
Author: User
Tags netbeans

Download Xdebug xdebug Download the corresponding version according to the PHP version and copy the contents of the local phpinfo () output to https://xdebug.org/wizard.php.

Analyze the current environment need to download which version of Xdebug, put the file in the PHP installation directory ext directory, modify the php.ini configuration file, add the following:

[Xdebug]

;zend_extension=C:\wamp\PHP5\ext\php_xdebug.dll 

zend_extension = "<path to Php_xdebug.dll>" ;是否开启远程调试xdebug.remote_enable = TrueRemote_host is the address of the debug client, which is the IP of the IDE, and the same remote_port is the port of the client, both of which are remotely debugged ;允许调试的客户端IPXdebug.remote_host xdebug.remote_host=127.0.0.1 ;远程调试的端口(默认9000) xdebug.remote_port= 9001; The Xdebug (remote) debugger allows you to test the data structure, step in, and debug your code. Xdebug provides two protocols for interacting with each other, Xdebug 2.1 and later versions only support dbgp protocols, remote debugging application-layer communication protocolsXdebug.remote_handler = DBGP; log trace output directory xdebug.trace_output_dir="C:/wamp/xdebug"Xdebug Detection Project Performance Profiler generally do not turn on performance monitoring, resulting in a large cache file;p rofiler_enable Boolean type, the default value is 0. Used to set whether the build report file is turned on and, if set to 1, a performance report file is generated for each request. xdebug.profiler_enable=0; Boolean type, default value 0. If this option is turned on, the performance report file is generated if the Get/post or cookie contains the Xdebug_profile variable name in each request (provided that the xdebug.profiler_enable option must be turned off otherwise this option will not work). xdebug.profiler_enable_trigger = OffA string type that sets the path where the generated report file is stored. xdebug.profiler_output_dir="C:/wamp/xdebug"

; string type. Used to set the name of the generated report file, such as cachegrind.out.%t.%p

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

Configuration Xdebug Idekey is phpstorm Debug and NetBeans debug required parameters, Phpstorm xdebug.idekey=phpstorm NetBeans xdebug.idekey=netbeans-xdebug
xdebug.idekey= "Phpstorm"

;自动打开“监测函数调用过程”的功模。该功能可以在你指定的目录中将函数调用的监测信息以文件的形式输出。此配置项的默认值为off

xdebug.auto_trace=On

;打开收集“函数参数”的功能。将函数调用的参数值列入函数过程调用的监测信息中。此配置项的默认值为off。

xdebug.collect_params=On

;打开收集“函数返回值”的功能。将函数的返回值列入函数过程调用的监测信息中。此配置项的默认值为off。

< EM id= "__mcedel" > < Span style= "font-family: Song body; font-size:14px "> xdebug.collect_return=on

< EM id= "__mcedel" > ; display default error message

< EM id= "__mcedel" >

配置php路径等:

配置PhpStorm:端口要和xdebug 中xdebug.remote_port=9001 一致

To configure servers, add the following PHP WEB application:

Configure DBGP Proxy where Idekey Port is the same as in the Xdebug configuration, one of the servers added in the host configuration above:

Chrome Browser installs Xdebug helper extension, option to add IDE key to the same as in Xdebug

Add PHP Web Application:

1. Select Edit Configurations

2, choose PHP Web application, add configuration:

Debug, select the PHP Web application you want to debug, then click on a phone-like button, then click the Beetle-like button:

As a result, the reported error occurs because the path to the file map is not found in project because it adds auto_prepend_file = "C:\Users\shanghai\AppData\Roaming\Composer\ in the php.ini you configured Vendor\autoload.php ", but does not affect the debugging, follow the red button operation can:

Recommended articles:

Https://confluence.jetbrains.com/display/PhpStorm/Debugging+with+PhpStorm

Http://redcrackle.com/blog/drupal-8/phpstorm

https://blog.jetbrains.com/webide/2011/03/configure-php-debugging-in-phpstorm-2-0/

Phpstorm Configuring Xdebug Debugging

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.