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:
- Go to System (Right click on start)
- Advanced system settings (left column)
- Advanced tab
- Environment Variables… -button at the bottom right.
- Select Path and click Edit
- Click new
- 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»