1. 程式人生 > 其它 >vs code配置PHP開發除錯環境

vs code配置PHP開發除錯環境

PHP 5.4.45 mysql

1 下載phpStudy整合開發環境

https://www.xp.cn/download.html

2 安裝繼承開發環境

3 安裝vs code 外掛 PHP Debug / PHPIntelephense

4 啟用Xdebug擴充套件,PHPStudy自帶了Xdebug擴充套件

5 除錯環境配置

vs code 除錯環境配置內容

{
    // 使用 IntelliSense 瞭解相關屬性。 
    // 懸停以檢視現有屬性的描述。
    // 欲瞭解更多資訊,請訪問: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0", "configurations": [ { "name": "Listen for Xdebug", "type": "php", "request": "launch", "port": 9003 //埠和php配置一致 }, { "name": "Launch currently open script", "type": "php",
"request": "launch", "program": "${file}", "cwd": "${fileDirname}", "port": 0, "runtimeArgs": [ "-dxdebug.start_with_request=yes" ], "env": { "XDEBUG_MODE": "debug,develop", "XDEBUG_CONFIG
": "client_port=${port}" } }, { "name": "Launch Built-in web server", "type": "php", "request": "launch", "runtimeArgs": [ "-dxdebug.mode=debug", "-dxdebug.start_with_request=yes", "-S", "localhost:0" ], "program": "", "cwd": "${workspaceRoot}", "port": 9003, "serverReadyAction": { "pattern": "Development Server \\(http://localhost:([0-9]+)\\) started", "uriFormat": "http://localhost:%s", "action": "openExternally" } } ] }