php版本:7.2.3
1.安裝xdebug
通過phpinfo();發(fā)現(xiàn)沒有xdebug吉执,所以需要下載安裝xdebug疯淫,下載網(wǎng)址:https://xdebug.org/download,下載對應版本即可戳玫。
image.png
下載完成后將下載的文件放在:/php/ext目錄下熙掺,如下圖:
image.png
2.修改php.ini配置文件,在php.ini文件中添加
[XDebug]
zend_extension=E:\myServer\php\ext\php_xdebug-3.0.4-7.2-vc15-x86_64.dll
php-cgi.exe -b 127.0.0.1:9000-c E:/myServer/php/php.ini
xdebug.mode = debug
xdebug.start_with_request = yes
xdebug.client_port = 9000
xdebug.remote_enable = 1
xdebug.remote_autostart = 1
3.配置vscdoe
(1)安裝php debug
image.png
(2)配置vscode
{
// 使用 IntelliSense 了解相關屬性量九。
// 懸停以查看現(xiàn)有屬性的描述适掰。
// 欲了解更多信息,請訪問: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Launch currently open script",
"type": "php",
"request": "launch",
"program": "${file}",
"cwd": "${fileDirname}",
"port": 9000
},
{
"name": "Listen for Xdebug",
"type": "php",
"request": "launch",
"port": 8089
}
]
}
image.png