microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
164.43k stars 29.34k forks source link

How to point to PHP executable? #16309

Closed TRE8 closed 7 years ago

TRE8 commented 7 years ago

Steps to Reproduce:

Hi, I'm trying to point VSCode to my PHP executable. I'm on a Mac and using MAMP Pro, which I believe is the PHP executable that I'm suppose to point to.

I've gone into settings.json and added this line:

// Points to the php executable.
"php.validate.executablePath":  "/Applications/MAMP/bin/php/php7.0.12/bin"

Here's an image to help if needed. screen shot - 2016-11-30 at 9 37 46 pm

Not sure if I entered the file path wrong or if I should use a different one, it doesn't seem to click. I still get a message that PHP executable is not connected to VSCode.

Also, new to Github and trying to tag this as a question but don't see an option to tag a label to this post.

chrmarti commented 7 years ago

The path needs to point at the php executable. (See https://code.visualstudio.com/Docs/languages/php.)

TRE8 commented 7 years ago

Thanks, I see in the docs it says { "php.validate.executablePath": "c:/php/php.exe" }

But I'm on a Mac :/

Can't seem to figure out where the PHP executable is located.

chrmarti commented 7 years ago

Have you tried "php.validate.executablePath": "/Applications/MAMP/bin/php/php7.0.12/bin/php"?

TRE8 commented 7 years ago

Good idea and I tried your suggestion but still get the message

The language server needs at least PHP 7 installed. Version found: 5.5.30

I tried adding ~ before "/Application" and got the following message: "php.validate.executablePath": "~/Applications/MAMP/bin/php/php7.0.12/bin/php"

Cannot validate the php file. The php program was not found. Use the 'php.validate.executablePath' setting to configure the location of 'php'

chrmarti commented 7 years ago

This issue was moved to felixfbecker/vscode-php-intellisense#37