0

I have VSCode installed, but don't seem to have php - i.e. there is no "php.exe" anywhere on my computer. No guides that I can find on the web about setting VSCode up for PHP suggests that I need to download and install php itself seperately (only debuggers and linters)... my question is:

Do I need to install PHP seperately? Should I have had to do this, or is there a bug in my VSCode installation...

3
  • 1
    Of course you need PHP as well... It's the same for other languages and other IDEs. You need to have some prerequisites installed, otherwise it won't work correctly. VS Code is just a bit smarter text editor, but it doesn't contain the languages themselves. Commented Sep 21, 2016 at 7:30
  • Hmm, I don't recall that I had to set up node (the only other back end thing I have used within VS Code), but maybe I have just forgotten. it's odd that even the noob-level guides to using php with VS don't mention that it is a seperate install. Commented Sep 21, 2016 at 7:43
  • @kpollock or they suspect you already installed PHP or XAMPP ;) Commented Sep 21, 2016 at 7:45

2 Answers 2

3

Yes you need to install PHP from the php website and then tell VSCode where PHP.exe is located.

VSCode is an editor not an interpreter. I think if you install PHP at the default location VSCode will automaticly pick it up but if not you need to specify its path in options.

If you install XAMPP you will get apache,php and mySql in one installation.

EDIT: an interpreter is software that translated your code(in your case PHP) into code that the CPU can understand and then executes.

Sign up to request clarification or add additional context in comments.

1 Comment

thx. It's just I don't recall having to install, say, node, but doubtless I did and have just forgotten. Far too many years of using the Visual Studio full version IDE must have spoiled me... or I am having a slow brain morning...
0

@kpollock it' not you. Yes, it should seem obvious that the language should be installed manually or separately, so you should have gotten that part, sorry. But no, there doesn't seem to be information anywhere about defining the underpinnings. This "understanding" seems to be left to the individual through research as you're doing.

After I installed PHP I manually set my environment PATH to include the PHP folder. OR in VS Code you can go to menu>File>Preferences>User Settings, the settings are maintained as a JSON object (unlike VS) and there is a PHP section for the .exe path.

Since you mentioned Node, you may not have installed Node.js manually. (I don't know if Node comes with VS Code either.) It might have come in with a VS2015 extension like Gulp or some other higher-level functionality, or maybe it was an installation option with VSC. If you can't use node or npm from a console, set your environment PATH to include it.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.