(一)php安裝xdebug擴展,PHPStorm+XDebug單步調試
(二)PHPStorm配置XDebug
(三)PHPStorm使用XDebug調試
(四)PhpStorm+Xdebug配置單步調試PHP
場景
在使用phpstorm等IDE編輯器編寫php代碼時,爲了更方便的調試,咱們須要安裝一款php的擴展插件 xdebug。本實例當前運行環境爲phpstudy集成環境。php
step1 進入xdebug官網,進入用戶下載引導頁
-
遊覽器輸入網址:https://xdebug.org或者直接搜索xdebug進入網站。html
-
點擊下方download進入下載頁面。點擊 custom installation instructions連接。phpstorm
step2 在用戶下載引導頁面粘貼當前phpinfo信息
- 打開phpinfo頁面
- 右鍵查看源代碼,全選複製
- 切換到用戶下載引導頁,將剛複製的phpinfo信息粘貼到輸入框內
- 點擊 下方 analyse my phpinfo() output 按鈕,系統將會推薦適合當前php版本信息的xdebug插件
step3.下載插件,並將插件放於指定目錄
step4.打開php.ini,在文件中加入xdebug設置
- 打開php.ini文件
- 在文件末尾加入如下幾行信息
zend_extension = "D:\phpStudy2018\PHPTutorial\php\php-7.1.13-nts\ext\php_xdebug-2.7.2-7.1-vc14-nts.dll" xdebug.remote_enable=1 xdebug.remote_handler=dbgp xdebug.remote_mode=req xdebug.remote_host=localhost xdebug.remote_port=9000 xdebug.idekey="PHPSTORM"
step5 重啓phpstudy,查看xdebug插件是否安裝成功
step6 配置phpstorm
通過上面幾個步驟,咱們就安裝好了php的xdebug擴展,而且配置好了phpstorm中的相關配置,下面就能夠使用phpstorm的xdebug功能進行調試工做啦。編輯器