1. PHP Installation Xdebug extension
PHP.ini configuration, the following configuration for reference only, the path to be replaced by their own!
[Xdebug]
Zend_extension=php_xdebug.dll
Xdebug.remote_handler= "DBGP"
Xdebug.remote_autostart=1
Xdebug.show_local_vars=1
xdebug.dump.get=*
xdebug.dump.post=*
xdebug.dump.server=*
Xdebug.auto_trace=on
; Default trace Output Directory/tmp
Xdebug.collect_vars = On
Xdebug.trace_output_dir=/tmp
Xdebug.collect_params=4
Xdebug.collect_return=on
Xdebug.profiler_enable=off
; Default trace Output Directory/tmp
; xdebug.profiler_output_dir=/tmp
; xdebug.profiler_enable_trigger=on
; test.php? Xdebug_profile
Xdebug.remote_enable=on
xdebug.remote_host= "localhost"
xdebug.remote_port=9000
Xdebug.remote_handler= "DBGP"
Xdebug.remote_log = "/tmp"
Xdebug.remote_connect_back=1
Xdebug.idekey=phpstorm
Ps:remote_handler, Remote_host, remote_port These all have default values, but are still recommended settings, at least know to set these parameters ~
View phpinfo~
2.PHPSTORM settings
Landlord used to use Zendstudio, just started with phpstorm very egg pain, after a period of time found to be very useful ~
1. First check the Xdebug configuration of the Phpstorm
The debug port here is consistent with the xdebug.remote_port inside the php.ini! The default is 9000, and if the 9000 port is occupied, it can be changed to another port.
2. Set Debug.
Add a local Web server~
Www.51open.pcom is my local web server~ ~
3. Start debugging
-
Hit the first breakpoint, SHIFT + F9 It's OK
-
Hit the first breakpoint, check the configured debug, press next to the bug button
Phpstorm+xdebug Breakpoints Debugging PHP