Git Product home page Git Product logo

Comments (15)

chrmarti avatar chrmarti commented on July 29, 2024 3

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

from vscode-php-intellisense.

felixfbecker avatar felixfbecker commented on July 29, 2024 3

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, eg "/Applications/MAMP/bin/php/php7.0.12/bin/php".
And it needs to be at least PHP 7.

from vscode-php-intellisense.

klaasvw avatar klaasvw commented on July 29, 2024 2

Have you tried php.executablePath instead of php.validate.executablePath? Even though the settings editor warns it doesn't recognise the configuration setting it does seem to solve the problem.

from vscode-php-intellisense.

ramseyjiang avatar ramseyjiang commented on July 29, 2024 1

"php.executablePath":'/usr/local/bin/php',

I did it as above, but block still not work

from vscode-php-intellisense.

erkanarslan avatar erkanarslan commented on July 29, 2024 1

I think this plugin does not detect php on linux environment or cannot use it. Because I set

"php.executablePath": "/usr/bin/php"

and it still does not work.

from vscode-php-intellisense.

theMyth721 avatar theMyth721 commented on July 29, 2024 1

I have just updated to macOS Big Sur 11.5.2 and also installed PHPIntellisense. I am not sure what is broken but VSCode seems to be pointing to the wrong PHP.
Its pointing to /usr/bin/php instead of /opt/homebrew/bin/php

I tried editing settings.json changed both php.executablePath and validate.executablePath and none made any difference

I have asked a question here on stack overflow:

https://stackoverflow.com/questions/68899144/wrong-php-version-executable-in-vscode-terminal-but-works-perfectly-in-mac-termi

from vscode-php-intellisense.

chrmarti avatar chrmarti commented on July 29, 2024

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

from vscode-php-intellisense.

chrmarti avatar chrmarti commented on July 29, 2024

From @TRE8 on December 1, 2016 17:43

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.

from vscode-php-intellisense.

chrmarti avatar chrmarti commented on July 29, 2024

From @TRE8 on December 1, 2016 23:43

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'

from vscode-php-intellisense.

AmirSimantov avatar AmirSimantov commented on July 29, 2024

@klaasvw - your suggestion of using php.executablePath instead of php.validate.executablePath works in my case. Thanks!

from vscode-php-intellisense.

vladonof avatar vladonof commented on July 29, 2024

Same issue here caused by having docker persistent storage in the root of the project.
What I ended up doing was chowning the persistent database folder, opening vs code, confirm it works, and only after that I would spin up my containers. It's annoying, but it works.

Also, this is what I've got in my settings

    "php.executablePath": "/usr/bin/php",
    "php.validate.enable": true,
    "php.validate.run": "onSave",
    "php.suggest.basic": false,

from vscode-php-intellisense.

Vangoly avatar Vangoly commented on July 29, 2024

Mac user.

Good evening guys. I am struggling to have xdebug working and I would appreciate some help.
Following this guide I think it is correct to add
"php.executablePath": "/Applications/MAMP/bin/php/php7.3.7/bin/php"
to the settings.json file to override the default values that are described here.
However, when I do try to edit the settings.json file I get a yellow outline saying that something is wrong. If I go to Code > preferences > settings I do not get the whole set of values, instead I get an User Interface that allows me to navigate through both User and Workspace settings. As a consequence, I am not able to find php.executablePath and then edit it.

Furthermore, I would like to disable php.validate.enable: true as @felixfbecker kindly suggested, but as per the same problem, I cannot find it as well.

All this pain, as I said, in order to have 'listen xdebug' working correctly. So far, it works only if I do restart constantly my MAMP servers.

Thank you so much for your help.

D.

I attach two files
Schermata 2019-08-15 alle 21 26 04

Schermata 2019-08-15 alle 21 33 29

from vscode-php-intellisense.

razan-rai avatar razan-rai commented on July 29, 2024

Within the Terminal, run vim ~/.bash_profile

Typeiand then paste the following at the top of the file:

export PATH=/Applications/MAMP/bin/php/php7.3.8/bin:$PATH
Hit ESC, Type :wq, and hit Enter

In Terminal, run source ~/.bash_profile

from vscode-php-intellisense.

Dominhodelapaz avatar Dominhodelapaz commented on July 29, 2024

I thaught I was close but no, Razan, the last was good until /Users/.../.bash_profile:1: permission denied: /Users/.../.profile
...@192 projekt %

from vscode-php-intellisense.

vzip avatar vzip commented on July 29, 2024

Within the Terminal, run vim ~/.bash_profile

Typeiand then paste the following at the top of the file:

export PATH=/Applications/MAMP/bin/php/php7.3.8/bin:$PATH Hit ESC, Type :wq, and hit Enter

In Terminal, run source ~/.bash_profile

THX

from vscode-php-intellisense.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.