Path to php executable on a mac with vscode and mamp Path to php executable on a mac with vscode and mamp php php

Path to php executable on a mac with vscode and mamp


I am using mac i have install php intellisense that required php version 7 executable pathi have already php 7 installed. Terminal command

which php

work for me.


I ran into this problem after installing the PHP Intellisense extension in vscode. For Intellisense to work I needed to point vscode at MAMP's version of PHP, not the default OS X version of PHP, but it did not recognise the path I was specifying.

I was able to resolve the issue by specifying the "php.executablePath" preference instead of "php.validate.executablePath".

"php.executablePath": "/Applications/MAMP/bin/php/php7.0.12/bin/php"

Here is an explanation from the author of the package:

validate has nothing to do with this extension, but is the built-in validation of VS Code. I would disable that, because you will get duplicate validation. php.executablePath should be set to the path of the binary