运行环境:
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的配置信息

1
2
3
4
5
6
7
[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

在这里插入图片描述

打上断点,此时调试运行按钮已经变绿 点击调试按钮即可开始进行调试
在这里插入图片描述