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