1. 程式人生 > >php學習筆記---PHPstorm設定斷點

php學習筆記---PHPstorm設定斷點

1.為php安裝xdebug,方法在上一篇中有詳細介紹

2.注意這個時候需要修改php.ini內容如下:

[Xdebug]
zend_extension_ts ="d:/wamp/php/ext/php_xdebug-2.1.2-5.2-vc6.dll"
xdebug.auto_trace=On
xdebug.collect_params=On
xdebug.collect_return=On
xdebug.trace_output_dir="d:/wamp/php/debuginfo"
xdebug.profiler_enable=On
xdebug.profiler_output_dir="d:/wamp/php/debuginfo"
xdebug.idekey=PhpStorm
xdebug.remote_enable=on
xdebug.remote_host=localhost
xdebug.remote_port=9000
xdebug.remote_handler=dbgp

3.phpstorm配置

  • 客戶端除錯,開啟phpStorm,進入File>Settings>PHP>Servers,這裡要填寫伺服器端的相關資訊,name填localhost,host填localhost,port填80,debugger選
  • 進入File>Settings>PHP>Debug,看到XDebug選項卡,port填9000,其他預設
  • 進入File>Settings>PHP>Debug>DBGp Proxy,IDE key 填 phpStorm,host 填localhost,port 填80
  • 點OK退出設定。

4.瀏覽器設定
   chrome有外掛xdebug helper下載後,設定白名單為localhost也就是預設localhost,才顯示小蟲子的圖示

5.啟動斷點:

   在phpstorm中設定斷點後,啟動監聽,就是電話一樣的圖示,然後用chrome瀏覽localhost中的指定斷點的檔案,會自動進入斷點,在phpstorm中看到除錯資訊。

具體的細節還在學習中。