1. 程式人生 > >wamp環境配置phpstorm的斷點除錯功能。和開啟debug會出現waiting for incoming connetcion with ide key 17173的問題

wamp環境配置phpstorm的斷點除錯功能。和開啟debug會出現waiting for incoming connetcion with ide key 17173的問題

我的環境:

1、修改php.ini檔案(修改完重啟apaceh)


xdebug.remote_enable = on
xdebug.idekey= PHPSTROM

【注意:遠端的使用下面的配置檔案,本地的使用上面的配置檔案】

remote_host 是指除錯客戶端的地址,即IDE所在的IP

remote_port 是客戶端的埠

這兩項在遠端除錯的情況下注意修改,遠端的時候最終改為:

[XDebug]

zend_extension ="d:/wamp64/bin/php/php5.6.25/zend_ext/php_xdebug-2.4.1-5.6-vc11-x86_64.dll"

xdebug.profiler_append = 0

xdebug.profiler_enable = 1

xdebug.profiler_enable_trigger = 0

xdebug.profiler_output_dir ="d:/wamp64/tmp"

xdebug.profiler_output_name = cachegrind.out.%t.%p

xdebug.remote_enable = 1

xdebug.remote_handler = "dbgp"

xdebug.remote_mode = "req"

xdebug.remote_port = 9000

2、開啟phpinfo()檢視配置情況,查詢xdebug項,找到了說明xdebug配置成功。


至此伺服器配置完畢!

3、下面是客戶端除錯。開啟phpStorm,進入File>Settings>PHP(檔案-設定-語言和框架-php),這裡要interpreter瀏覽,填D:\xampp\php\php.exe,自動識別版本。


4、 進入File>Settings>PHP>Servers,這裡要填寫伺服器端的相關資訊,name填localhost,host填localhost,port填80,debugger選XDebug。


5、 進入File>Settings>PHP>Debug,看到XDebug選項卡,port填9000,其他預設。


6、進入File>Settings>PHP>Debug>DBGp Proxy,IDE key 填 PHPSTORM,host 填localhost,port填9000,點OK退出設定。


7、修改臭蟲或執行時開啟的網站(你想要除錯網站的url)



點OK退出設定之後,phpstorm執行按鈕旁邊自動填充localhost,且執行按鈕由灰色被啟用成為綠色

8、 chrome瀏覽器連結配置。找到對應的外掛,chrome的為phpstrom IDE Support chrome.crx,自己下載然後拖動檔案到chrome設定>擴充套件程式


谷歌瀏覽器的右上角


使用時候出的問題:

如果本地跑出現這個問題,是因為1中的php.ini配置檔案,修改不正確,請按照1中php.ini修改,並重啟apache

【注意】

如果需要切換除錯的專案,別忘了修改第7步哦~