To download & install the PHP Interpreter and use it in PHPStorm :
1. Visual C++ Redistributable
- Make sure you've installed Visual C++ Redistributable for Visual Studio 2015-2019 : x64 or x86
2. PHP Interpreter (CLI)
- Download the last version of the PHP interpreter (current: 2020-Apr-14 / PHP 7.4.5) at https://windows.php.net/download
There you've to choose between Non Thread Safe (NTS) and Thread Safe (TS) versions.
- If you are using PHP as FastCGI with IIS you should use the Non-Thread Safe (NTS) versions.
- Otherwise proceed to download the Thread Safe (TS) version.
Click the "Zip" link that suit your processor architecture (x64 for 64bit, x86 for 32bit or lower).
After the downloading the file, extract the .zip archive in the directory of your choice (for example, in C:\php\)
- Open the directory you just extracted, you will see bunch of directories (dev, ext, lib, ...), DLL files and executables. Spot the php.exe, that's our PHP interpreter :)
3. Configure PHPStorm interpreter
- In PHPStorm, go to "File" menu (Windows), then Settings (
Ctrl+Alt+S). - Go to "Languages & Frameworks", then click on "PHP".
- Click the
...button from the "CLI Interpret" field. - Add a new interpreter by clicking the
+button. Here, provide the PHP Executable path to the php.exe we've spotted earlier (eg.: C:\php\%currentPhpVersionDir%\php.exe).
If done correctly, PHPStorm will display the PHP version & the path to the configuration file (php.ini).
That's all for linking PHPStorm to a PHP interpreter in itself.
Answer from Adri1 on Stack OverflowUsing PHP as CLI Interpreter in PhpStorm
php - How to add interpreter to PhpStorm 2016.1.1 - Stack Overflow
PHPStorm 7 don't find PHP Interpreter on Windows - Stack Overflow
apache - How to install CLI interpreter to run .php file in PhpStorm? - Stack Overflow
Videos
Copy the php directory to the root folder of your Web server
Then Open phpstorm
Click File > settings to open the preferences dialog and click PHP under Languages and Framework
On the PHP page that opens click on the button next to the interpreter
On the interpreter dialog box, click add toolbar on the left hand pane, and choose local from the context menu
On the right hand pane specify the PHP interpreter settings
in the name text box, enter any name to identify the interpreter, for example,
php_installatuon_7Specify the location of the php installation directory by typing manually or click the browse button and choose the location in the dialog box
Click OK to complete the process
Screenshots below to guide you through the process
https://www.jetbrains.com/help/phpstorm/2016.1/configuring-local-php-interpreters.html
In case "php language level" Field is disabled you can simply change your PHP version in
composer.json file
"require": {
"php": ">=X.X.X",
}
//...
"config": {
"platform": {
"php": "X.X.X"
},//...
also if you have problem in Composer delete it (composer.phar) and download it again



