Debug PHP with X-debug under IntelliJ idea

Source: Internet
Author: User

Use IntelliJ idea to debug PHP using X-debug, the main need to configure the section has three places, respectively, the configuration of php.ini , the configuration of idea and browser configuration, mainly as follows:

The main configuration of php.ini (Wamp modified Phpforapache.ini) is as follows, and the key parameters can be modified according to the actual situation:

xdebug:https://xdebug.org/download.php

[xdebug]zend_extension_ts= "D:/wamp/bin/php/php7.1.16/zend_ext/php_xdebug-2.6.0-7.1-vc14-x86_64.dll"
#如果不是ts版本请用zend_extension =
#host值最好用当前用到的域名或者127.0.0.1xdebug.remote_host=abc.comxdebug.remote_port = 9000xdebug.remote_mode = "Req" xdebug.remote_enable = Onxdebug.remote_handler = Dbgp#key value can be any value Xdebug.idekey = "Xdebug_info" xdebug.profiler_enable= on# do not create this directory xdebug.trace_output_dir= "D:/wamp/bin/php/debug" xdebug.profiler_output_dir= "D:/wamp/bin/php/debug" Xdebug.auto_trace=onxdebug.collect_params=onxdebug.collect_return=onxdebug.show_exception_trace = Onxdebug.remote_autostart = Onxdebug.collect_vars = On

Configured, input in cmd

Php-m

If you can see the Xdebug module, the opening is successful.

*: It is worth noting that the corresponding version of Xdebug and PHP needs to be determined here.

IDEA is configured as follows:
Enter File>settings>php>servers, here to fill in the server side of the relevant information, name fill the hostname to debug (such as: abc.com or localhost, etc.), host fill (such as: localhost or abc.com, etc.), Port fill 80,debugger Select Xdebug

Enter File>settings>php>debug, see Xdebug tab, Port Fill 9000, other default

Enter FILE>SETTINGS>PHP>DEBUG>DBGP proxy,ide key to fill in the xdebug_info, host fill Abc.com,port fill 80

And PHP.ini's ide_key to be consistent oh ... 、

Better be free to build a remote_debug check it out.

And finally the browser settings i downloaded is xdebug Helper

Debug PHP with X-debug under IntelliJ idea

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.