Visual Studio란

Visual Studio는 전체 개발 주기를 한 곳에서 완료하는 데 사용할 수 있는 강력한 개발자 도구입니다. 코드를 작성, 편집, 디버그 및 빌드한 다음 앱을 배포하는 데 사용할 수 있는 포괄적인 IDE(통합 개발 환경)입니다. 코드 편집 및 디버깅 외에도 Visual Studio에는 컴파일러, 코드 완성 도구, 소스 제어, 확장 및 소프트웨어 개발 프로세스의 모든 단계를 향상시키기 위한 더 많은 기능이 포함되어 있습니다.

 

Visual Studio Code란

비주얼 스튜디오 코드Visual Studio Code는 마이크로소프트Microsoft에서 오픈소스로 개발하고 있는 소스 코드 에디터입니다. 웹 기반으로 기술들로 데스크톱 애플리케이션을 만들 수 있는 깃허브GitHub의 일렉트론Electron을 기반으로 만들어져 맥OSmacOS, 리눅스Linux, 윈도우Windows 등 메이저 운영체제를 모두 지원하고 있습니다. 마이크로소프트의 통합 개발 환경(IDE) 비주얼 스튜디오Visual Studio와 이름이 비슷하지만 따로 개발되고 있으며 IDE보다는 코드 에디터에 가깝습니다. MIT 라이센스로 오픈소스로 공개되어 있으며, 무료로 사용할 수 있습니다.

 

Visual Studio와 Visual Studio Code (VS Code)의 비교

간단히 정리해보자면...

공통점

- 개발을 위한 코드 에디터

- 다양한 extentions 지원

- 다양한 언어 지원

 

차이점

Visual Studio Visual Studio Code(VS Code)
- 포괄적인 통합 개발 툴
(개발을 위한 코드 편집 및 디버거, 컴파일러, 코드 완성 도구, 소스 제어 등 많은 기능이 이미 포함되어 있음)

- 대규모 프로젝트, 엔터프라이즈 개발, Windows, .NET, and Azure 같은 특정 플랫폼을 대상으로 하는 프로젝트에 특히 적합
- 경량화된 크로스 플랫폼 코드 에디터
(가벼운 코드 에디터로 출발 하나, 사용자의 니즈에 따라 디버거, 컴파일러, 코드완성도구, 언어 등을 확장팩으로 추가 가능하여, 결과적으로 VisualStudio와 유사한 효과를 냄)

- 웹 개발, 오픈 소스 프로젝트 및 크로스 플랫폼 개발에 인기 있음

 

Visual Studio and Visual Studio Code (VS Code) are both popular development environments, but they have some key differences:

  1. Purpose and Scope:
    • Visual Studio (often referred to as Visual Studio IDE) is a comprehensive Integrated Development Environment provided by Microsoft. It supports a wide range of programming languages and frameworks, including C++, C#, .NET, and more. It offers extensive features for building, debugging, testing, and deploying applications.
    • Visual Studio Code (often abbreviated as VS Code) is a lightweight, cross-platform code editor that is highly customizable. It provides excellent support for various programming languages through extensions. It is known for its versatility and ease of use.
  2. Extensibility:
    • Visual Studio has an extensive ecosystem of plugins and extensions, which allows developers to enhance the IDE's functionality. These extensions can provide additional tools, language support, project templates, and more.
    • Visual Studio Code is designed from the ground up to be extensible. It has a vast library of extensions available through its marketplace, allowing users to customize and tailor their development environment to their needs.
  3. Language and Framework Support:
    • Visual Studio has extensive support for a wide range of programming languages and frameworks, including .NET, C++, C#, Python, JavaScript, and more. It provides rich language-specific features, debugging capabilities, and project templates for these languages.
    • Visual Studio Code also supports a wide range of programming languages and frameworks, thanks to its large collection of extensions. It offers syntax highlighting, code completion, debugging support, and more for popular languages like JavaScript, Python, Java, C++, and many others.
  4. Integrated Tools:
    • Visual Studio comes with a rich set of built-in tools for various development tasks, such as a powerful debugger, code refactoring tools, performance profilers, database integration, and more.
    • Visual Studio Code provides a basic set of features out of the box, but it relies on extensions to provide more specialized tools. Users can install extensions for specific tasks like debugging, version control, linting, code formatting, and more.
  5. Project Types and Workflows:
    • Visual Studio is particularly well-suited for large-scale projects, enterprise development, and projects targeting specific platforms like Windows, .NET, and Azure. It provides extensive project templates, project management tools, and integration with various Microsoft services and platforms.
    • Visual Studio Code is a lightweight and versatile code editor that can be used for a wide range of projects and workflows. It is popular among web developers, open-source projects, and cross-platform development.

Ultimately, the choice between Visual Studio and Visual Studio Code depends on your specific needs, project requirements, and personal preferences. Visual Studio provides a full-featured IDE experience, while Visual Studio Code offers a lightweight and customizable code editing environment.

 

참고

https://learn.microsoft.com/ko-kr/visualstudio/get-started/visual-studio-ide?view=vs-2022 

https://www.44bits.io/ko/keyword/visual-studio-code

Chat GPT

윈도우 운영체제에서 php 7.4를 설치하고, VScode 디버깅 설정하는 방법을 정리한다.

 

PHP 7.4 설치

1. 아래 사이트에서 windows용 php를 다운받는다. (설치할 버전)

https://windows.php.net/download/

 

2. 적절한 폴더에 압축을 해제한다.

예) C:/APM/php-7.4.33-Win32-vc15-x64

 

3. httpd.conf 파일 설정에서, php 경로를 변경해준다.

PHPIniDir "C:/APM/php-7.4.33-Win32-vc15-x64"
LoadModule php7_module "C:/APM/php-7.4.33-Win32-vc15-x64/php7apache2_4.dll"
AddType application/x-httpd-php .html .php
AddHandler application/x-httpd-php .php

 

4. 고급 시스템 설정에 php 경로를 등록해준다. (어디서든 php.exe 실행 가능하게 하려면)

예) C:/APM/php-7.4.33-Win32-vc15-x64 추가

 

5. 아파치를 재시작한다.

서비스 > Apache2.4 다시시작

 

VScode 에 php 디버깅 설정

1. cmd 창에 "php -i" 입력하면 phpinfo 내용이 쭉 나온다. 전부 복사한다.

 

2. https://xdebug.org/wizard 사이트에 가서 해당 내용을 붙여넣는다.

 

3. Analyse my phpinfo() output 버튼을 클릭한다.

 

4. 내 정보가 나오고, 해당 내용에 맞는 dll을 다운받을 수 있는 녹색 링크가 나온다. 클릭해서 다운받는다.

5. php 압축 푼 폴더 하위에 해당 dll을 복사한다.

예) C:\APM\php-7.2.34-Win32-VC15-x64\ext\php_xdebug-3.0.0-7.2-vc15-x86_64.dll

 

6. cmd 창에 php -m 입력해서 [PHP Modules]와 [Zend Modules]에 Xdebug가 있는지 확인한다.

 

7. php.ini 파일 설정을 변경한다.

- 기존 설정이 있는 경우, 동일하게 맞춤

- 디버깅을 위해, 아래와 같이 xDebug 설정을 추가한다.

예) C:/PHP/php-7.4.33-Win32-vc15-x64/php.ini 

[xDebug]
zend_extension = C:/APM/php-7.4.33-Win32-vc15-x64/ext/php_xdebug-3.1.6-7.4-vc15-x86_64.dll
xdebug.mode=debug
xdebug.start_with_request=yes
xdebug.client_host = localhost
xdebug.client_port = 9003
xdebug.output_dir = C:/APM/php-7.4.33-Win32-vc15-x64/tmp

 

8. 아파치를 재시작한다.

 

9. VScode를 열어, launch.json 파일 내용을 아래와 같이 수정한다.

(위 php.ini 에서 설정한 port 가 일치하도록 하고, php가 설치된 경로를 넣어준다.)

{
    // Use IntelliSense to learn about possible attributes.
    // Hover to view descriptions of existing attributes.
    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Listen for XDebug",
            "type": "php",
            "runtimeExecutable": "C:/APM/php-7.4.33-Win32-vc15-x64/php.exe",
            "request": "launch",
            "port": 9003
        },
        {
            "name": "Launch currently open script",
            "type": "php",
            "runtimeExecutable": "C:/APM/php-7.4.33-Win32-vc15-x64/php.exe",
            "request": "launch",
            "program": "${file}",
            "cwd": "${fileDirname}",
            "port": 9003
        },
        {
            "name": "Launch Index",
            "type": "php",
            "runtimeExecutable": "C:/APM/php-7.4.33-Win32-vc15-x64/php.exe",
            "request": "launch",
            "program": "${workspaceRoot}/index.php",
            "cwd": "${workspaceRoot}",
            "port": 9003
        }
    ]
}

 

10. VScode에서 settings.json을 열어 php path를 아래와 같이 바꾸어준다.

    "php.validate.executablePath": "C:/APM/php-7.4.33-Win32-vc15-x64/php.exe",
    "php.validate.enable": false,
    "php.executablePath": "C:/APM/php-7.4.33-Win32-vc15-x64/php.exe",

 

11. 테스트용 index.php 파일 만들고, VScode에서 F5 눌러 디버깅 모드 실행한다.

 

12. 웹 브라우저에서 index.php를 실행해본다. 디버깅이 걸리면 성공!

+ Recent posts