標籤:dump inf ati auto ide 斷點 bgp test strong
1. PHP安裝xdebug擴充
php.ini的配置,下面的配置僅供參考,路徑要換成自己的!
[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 這些都有預設值,但還是建議設定下,至少知道要設定這些參數~
查看phpinfo~
2.PHPSTORM設定
樓主以前一直用zendstudio,剛開始用phpstorm非常蛋疼,用了一段時間後發現還挺好用的~
1.首先檢查phpstorm的xdebug配置
這裡的debug port要和php.ini裡面的xdebug.remote_port相一致!預設是9000,如果9000連接埠被佔用的話,可以改成其他連接埠。
2. 設定debug.
添加本地的 web server~
www.51open.pcom 是我本地的 web server~ ~
3.開始調試
-
打好第一個斷點,shift + F9就可以了
-
打好第一個斷點,選中配置的debug, 按旁邊的臭蟲 按鈕
phpstorm+Xdebug斷點調試PHP