Check! Visual Studio Code에서 PHP 디버깅 실행(Xdebug)
4940 단어 디버깅PHPxdebugVisualStudioCode
Prologue - 소개
프라이빗에서도 사용하고 있는 Visual Studio Code 로 PHP 디버그를 할 수 있도록(듯이), PHP Debug 의 확장 기능을 도입해 보았습니다!

Visual Studio Code란?
글쎄, Visual Studio Code은 Microsoft 오픈 소스 편집기입니다.
Javascript를 비롯해 PHP도 어느 정도 보완해주고, 간단하면서도 사용하기 쉬운 에디터입니다. Windows는 물론 Mac, Linux에서도 사용할 수 있으므로 양도로도 편리합니다.
Visual Studio Code > Debuggers > PHP Debug
전제
대략적인 흐름
절차
대상 서버의 xdebug 설정
대상 서버의 xdebug 설정이 다음과 같은지 확인하십시오.
xdebug.remote_enable=1
xdebug.remote_autostart=1
Visual Studio Code 확장 프로그램 설치
Visual Studio Code 명령 팔레트를 열고 ext install을 입력한 다음 Extensions: Install Extension을 클릭합니다.

PHP Debug
를 클릭하여 설치합니다.

Visual Studio Code 디버깅 설정
Visual Studio Code에서 디버깅할 코드가 포함된 디렉터리를 엽니다.
디버그 화면을 열고 톱니바퀴 표시를 클릭하여 환경 설정을 엽니다.

launch.json
가 열리므로 다음과 같이 설정합니다.
.vscode/launch.json{
"version": "0.2.0",
"configurations": [
//-- ここから
{
"name": "Custom Xdebug setting",
"type": "php",
"request": "launch",
"port": 9000,
"serverSourceRoot": "/var/www/html",
"localSourceRoot": "${workspaceRoot}"
}
//-- ここまで
]
}
품목
내용
name
설정 이름(임의의 문자열)
type
php
request
launch
port
xdebug 포트 (기본적으로 9000
)
serverSourceRoot
대상 서버의 문서 루트
localSourceRoot
로컬 컴퓨터의 소스 코드 디렉터리 (.
Epilogue - 결론
잠시 사용하고 있습니다만, 특히 불편 없이 이용하고 있습니다. 꼭 사용해보세요!
Reference
이 문제에 관하여(Check! Visual Studio Code에서 PHP 디버깅 실행(Xdebug)), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다
https://qiita.com/dz_/items/fb574782f4b4b30149a8
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
우수한 개발자 콘텐츠 발견에 전념
(Collection and Share based on the CC Protocol.)
xdebug.remote_enable=1
xdebug.remote_autostart=1
Visual Studio Code에서 디버깅할 코드가 포함된 디렉터리를 엽니다.
디버그 화면을 열고 톱니바퀴 표시를 클릭하여 환경 설정을 엽니다.

launch.json
가 열리므로 다음과 같이 설정합니다..vscode/launch.json
{
"version": "0.2.0",
"configurations": [
//-- ここから
{
"name": "Custom Xdebug setting",
"type": "php",
"request": "launch",
"port": 9000,
"serverSourceRoot": "/var/www/html",
"localSourceRoot": "${workspaceRoot}"
}
//-- ここまで
]
}
품목
내용
name
설정 이름(임의의 문자열)type
php
request
launch
port
xdebug 포트 (기본적으로 9000
)serverSourceRoot
대상 서버의 문서 루트localSourceRoot
로컬 컴퓨터의 소스 코드 디렉터리 (.Epilogue - 결론
잠시 사용하고 있습니다만, 특히 불편 없이 이용하고 있습니다. 꼭 사용해보세요!
Reference
이 문제에 관하여(Check! Visual Studio Code에서 PHP 디버깅 실행(Xdebug)), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다
https://qiita.com/dz_/items/fb574782f4b4b30149a8
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
우수한 개발자 콘텐츠 발견에 전념
(Collection and Share based on the CC Protocol.)
Reference
이 문제에 관하여(Check! Visual Studio Code에서 PHP 디버깅 실행(Xdebug)), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다 https://qiita.com/dz_/items/fb574782f4b4b30149a8텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
우수한 개발자 콘텐츠 발견에 전념
(Collection and Share based on the CC Protocol.)