0

I am following a tutorial about web programming, it recommended to install PhpStorm then opened a CMD and wrote this command to create a web server:

php -S localhost:50 

But when I did it (after installing PhpStorm successfully) it gives me this error message:

'php' is not recognized as an internal or external command, operable program or batch file.

I searched for this error and all the solutions say the c:\XAMPP should be added to system path, but I checked for it and I don't have XAMPP in my computer.

Should I download and install it? I ask because the tutorial didn't it!

LazyOne
  • 158,824
  • 45
  • 388
  • 391
Hasani
  • 3,543
  • 14
  • 65
  • 125
  • 3
    Possible duplicate of [What is the reason for '...' is not recognized as an internal or external command, operable program or batch file?](https://stackoverflow.com/questions/41454769/what-is-the-reason-for-is-not-recognized-as-an-internal-or-external-comman) – Mofi May 01 '18 at 13:16

1 Answers1

0

You do not per se need to install XAMPS. The minimum you need is to download the PHP interpreter (.exe), and select that in PhpStorm as your project (or default) interpreter. After that, you should be able to launch the page by clicking any of the browser icons that appear in the top right when you hover over a PHP file in PhpStorm.

  • File > Settings... (ctrl + alt + s)
  • Languages & Frameworks > PHP
  • Next to CLI interpreter, click the three dots and select the executable of your PHP interpreter.
Bruno Ryckaert
  • 119
  • 1
  • 6