Get PHP Intellisens to work in Visual Studio Code, on Windows 10

Robert AndresenUncategorized Leave a Comment

Step 1: Download PHP

Download PHP from here: https://www.php.net/downloads.php, click on Windows downloads.

I just downloaded the .zip file at the top:

VC15 x64 Non Thread Safe (2020-Mar-17 16:16:15)
Zip [24.78MB]
sha256: 1a1a90e07dfcc3b5b0f1847c2de58c7bf5386e5dd4616d680fe8bee27a24985e

Extract .zip file

I extracted it to C:/data/php-7.4.4-nts-Win32-vc15-x64

Step 2: Add environment path

I found this article with some nice images: https://www.forevolve.com/en/articles/2016/10/27/how-to-add-your-php-runtime-directory-to-your-windows-10-path-environment-variable/

Basically you have to:

  1. Go to System (Right click on start)
  2. Advanced system settings (left column)
  3. Advanced tab
  4. Environment Variables… -button at the bottom right.
  5. Select Path and click Edit
  6. Click new
  7. Insert path to where you extracted PHP files (e.g. C:\Data\php-7.4.4-nts-Win32-vc15-x64)

Step 3: Install PHP Intellisens

Go to Extentions in Visual Studio Code, or click here: https://marketplace.visualstudio.com/items?itemName=felixfbecker.php-intellisense

Install the extention.

You will be promted with a notification that PHP was not found, if not restart Visual Studio Code.

Open the settings from the notification and add the path, in my case: «php.validate.executablePath»: «C:/Data/php-7.4.4-nts-Win32-vc15-x64/php.exe»