본문으로 바로가기

Visual Studio Code + php 사용시 오류

category 기타자료 2020. 2. 15. 20:01

PHP IntelliSense 사용시

 

PHP PATH 오류

PHP executable not found. Install PHP 7 and add it to your PATH or set the php.executablePath setting

1. php가 설치되어있지 않다면 php를 다운로드받기.

   다운로드 받은 디렉토리의 php.exe 파일을 2번처럼 등록

 

 

2. File -> Preferences -> Settings

검색창에 php 검색 -> PHP IntelliSense -> PHP:Executable Path -> Edit in settings.json 

아래 코드 추가

{
    생략...
    "php.validate.executablePath": "C:\\php7.0.4\\php.exe",
    "php.executablePath": "C:\\php7.0.4\\php.exe"
}

 

vcruntime140오류 발생시

Error spawning PHP: Command failed: C:\php-7.4.2\php.exe --version PHP Warning: 'vcruntime140.dll' 14.0 is not compatible with this PHP build linked with 14.16 in Unknown on line 0

 

아래 패키지 설치가 필요함

 

https://visualstudio.microsoft.com/ko/downloads/ 

에서 기타 도구 및 프레임워크 > Visual Studio 2019용 Microsoft Visual C++ 재배포 가능 패키지 다운로드

또는 

https://support.microsoft.com/pt-br/help/2977003/the-latest-supported-visual-c-downloads