一、安装PHP Debugphp
2.vs code设置phpstorm
...ide
...spa
"php.validate.executablePath": "D:/BtSoft/WebSoft/php/7.1/php.exe", 插件
}debug
}3d
3.配置xdebug调试
建立一个test.php
,建立一条语句phpinfo()
,而后将获得的信息粘贴到XDebug官网 XDebug installation wizard这个页面中。这个页面会分析好你的PHP环境code
下载XDebug.dllorm
复制到{phproot}/ext/
在{phproot}/php.ini中
[XDebug]
zend_extension = "D:\BtSoft\WebSoft\php\7.1\ext\php_xdebug-2.9.1-7.1-vc14-nts.dll"
xdebug.auto_trace=on
xdebug.collect_params=on
xdebug.collect_return=on
xdebug.remote_enable = on
xdebug.remote_handler = dbgp
xdebug.remote_host = localhost
# 设置端口号,默认是9000,此处由于本地环境端口冲突故设置为9001(在vscode配置中须要用到)
xdebug.remote_port = 9001
xdebug.remote_autostart=on
# 这是用于phpstorm中xdebug调试的配置,在vscode中没有用到
xdebug.idekey = phpstorm
四、必须先打开您的php项目目录,而后才能设置debug
点击齿轮,选择php--》选择listen for xdebug
端口设置为9001
五、打开php文件,在按F9设置断点, 点
启动调试。
六、访问可调试网页