phpstorm+Xdebug斷點調試PHP

來源:互聯網
上載者:User

標籤: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.開始調試

  1. 打好第一個斷點,shift + F9就可以了

  2. 打好第一個斷點,選中配置的debug,  按旁邊的臭蟲 按鈕



                    

phpstorm+Xdebug斷點調試PHP

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

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.