phpStorm配置xdebug

運行環境:
PHPSTORM版本 : 2019.3 漢化
PHP版本 : php-7.0.12-nts
xdebug版本:php_xdebug-2.6.0beta1-7.0-vc14-nts
ps : php版本和xdebug版本一定要相對應
xdebug下載地址:http://xdebug.org/download.php

1.環境下的php.ini中添加關於xdebug的配置信息

[XDebug]
zend_extension="D:\phpStudy\php\php-5.6.27-nts\ext\php_xdebug.dll"
xdebug.remote_enable=On
xdebug.remote_handler=dbgp
xdebug.remote_host=localhost
xdebug.remote_port=9000
xdebug.idekey=PHPSTORM

2.重啓查看phpinfo()會顯示有關xdebug的信息

3.開始配置phpStorm

1.客戶端調試,打開phpStorm,進入File>Settings>PHP>Servers,這裏要填寫服務器端的相關信息,name填localhost,host填localhost,port填80,debugger選[XDebug]
在這裏插入圖片描述

2.進入File>Settings>PHP>Debug,看到XDebug選項卡,port填9000,其他默認
端口和php.ini的配置要一致
在這裏插入圖片描述

3.進入File>Settings>PHP>Debug>DBGp Proxy,IDE key 填 phpStorm,host 填localhost,port 填80

在這裏插入圖片描述

此時phpstorm上面的調試運行按鈕是灰色的

在這裏插入圖片描述

點擊+號增加服務
在這裏插入圖片描述

先配置server

在這裏插入圖片描述

打上斷點,此時調試運行按鈕已經變綠 點擊調試按鈕即可開始進行調試
在這裏插入圖片描述

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章