一. 準(zhǔn)備
1.1 下載 xdebug
我本地用的是 phpStudy 的集成環(huán)境, php 版本是 7.2.10
在 Xdebug 下載地址(https://xdebug.org/download/historical)找到合適的版本(這邊包含歷史版本),我選的是 PHP 7.2 VC15 (32 bit)
1.2 配置 PHP
將下載好的文件放入 php 下的 ext 文件夾內(nèi),以我本機(jī)為例 (E:\Castle\phpStudy\PHPTutorial\php\php-7.2.1-nts\ext)
php.ini 拉到最下面,加上以下內(nèi)容
[XDebug]
xdebug.profiler_output_dir="E:\Castle\phpStudy\PHPTutorial\tmp\xdebug"
xdebug.trace_output_dir="E:\Castle\phpStudy\PHPTutorial\tmp\xdebug"
zend_extension="E:\Castle\phpStudy\PHPTutorial\php\php-7.2.1-nts\ext\php_xdebug-2.9.5-7.2-vc15-nts.dll"
xdebug.remote_enable = 1
xdebug.remote_handler = dbgp
xdebug.remote_host = "localhost"
xdebug.remote_mode = req
xdebug.remote_port = 9010
xdebug.idekey="PHPSTORM"
xdebug.remote_autostart = 1
1.3 打印 phpinfo() 頁面
看 Xdebug 是不是已經(jīng)有了,如果沒有一般都是下載的版本錯(cuò)了

二. PhpStorm 配置
2.1 Settings 處的配置
2.1.1 從 File > Settings,輸入 PHP,紅框處的就是我們需要配置的地方

2.1.2 先配置一下 PHP 的版本(我本地用的 7.2,)

2.1.3 Debug port 這邊的值用之前在 php.ini 里面新增的值,其它不動(dòng)

2.1.4 DBGp Proxy 這邊的值也使用之前 php.ini 里面新增的

2.1.5 配置 Servers (到這邊為止設(shè)置里面就配置完畢了)

2.2 新增 debug 配置
2.2.1 從箭頭處進(jìn)入,選擇 PHP Web Page 新建


2.2.2 配置完畢

三. 舉例說明
3.1 在前面打上斷點(diǎn),正常就會(huì)出現(xiàn)如下內(nèi)容啦

3.2 postman 請(qǐng)求 (基本沒有區(qū)別,唯一要注意的就是 2.1.5 配置 Servers 這邊的 Host 配置了,你的請(qǐng)求域名是什么就填什么就可以了)
總結(jié)
到此這篇關(guān)于PhpStorm2020.1 安裝 debug - Postman 調(diào)用的文章就介紹到這了,更多相關(guān)PhpStorm2020.1 安裝 debug內(nèi)容請(qǐng)搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!
您可能感興趣的文章:- postman的安裝與使用方法(模擬Get和Post請(qǐng)求)
- Postman的下載及安裝教程詳解
- 使用postman操作ElasticSearch的方法
- Postman安裝與使用詳細(xì)教程 附postman離線安裝包