简体   繁体   中英

VSCode - php not installed?

I have VSCode installed, but don't seem to have php - ie 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...

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.

@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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM