Type: boolean, Default value: 0
This switch controls whether Xdebug should try to contact a debug client which is listening on the host and port as set with the settings xdebug.remote_host and xdebug.remote_port. If a connection can not be established the script will just continue as if this setting was 0.

此開關控制著Xdebug是否應該嘗試聯系debug客戶端,這個客戶端正在監聽配置好的host和port. 如果這項配置為0,則當無法連接時,腳本會啥都不做,繼續執行。

 

④ xdebug.remote_autostart=1

Type:boolean, Default value:0

Normally you need to use a specific HTTP GET/POST variable to start remote debugging (seeRemote Debugging). When this setting is set to 1, Xdebug will always attempt to start a remote debugging session and try to connect to a client, even if the GET/POST/COOKIE variable was not present.

通常你需要使用一個特定的HTTP GET/POST 變量來啟動遠程bugging. 當此配置為1時, Xdebug將永遠會試圖遠程debugging session,并嘗試連接一個客戶端,即便 GET/POST/COOKIE變量沒有出現。

 

3, 重啟php服務

sudo service php5.6-fpm restart

 

4, 在IDE中添加Debug的Host和Port,進入PhpStorm->File->Settings->Languages & Frameworks->Servers->

保存后,此時可以在具體的代碼文件頁面看到debug的標識,

在這里單擊一下,有一個紅色的圓圈,代表在此處設置一個斷點(break point)

用Postman請求到這個文件,可以看到在IDE下方,出現了很多信息

這些變量值直接展示出來了,而不要再另外去打斷點來查看。

 

當然,以上只是xdebug很小的一部分功能。更重要的是用來做性能分析,代碼邏輯優化等,這個過一段時間再來更新。

更多關于云服務器,域名注冊,虛擬主機的問題,請訪問三五互聯官網:www.shinetop.cn

贊(0)
聲明:本網站發布的內容(圖片、視頻和文字)以原創、轉載和分享網絡內容為主,如果涉及侵權請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網站立場,如需處理請聯系客服。郵箱:3140448839@qq.com。本站原創內容未經允許不得轉載,或轉載時需注明出處:三五互聯知識庫 » PHP-Xdebug在PhpStorm中的使用

登錄

找回密碼

注冊