How to set php executable path php.validate.executablePath in vscode when php is set inside docker container?

后端 未结 13 1342
既然无缘
既然无缘 2021-01-30 08:47

I have a development environment based in docker.

Everytime that I open VSCode I get this message:

Cannot validate since no PHP executable is set.

相关标签:
13条回答
  • 2021-01-30 09:31

    "php.validate.executablePath": "C:/php/php.exe" wont work due to incorect escaping

    try this;

    "php.validate.executablePath": "C:\\php\\php.exe"
    
    0 讨论(0)
  • 2021-01-30 09:40

    I also got this error message. The path to php.exe was already set in my System Environment Variables.

    The error went away when I commented out "php.validate.executablePath": "c:/path/to/php7.2.10/php.exe", in the settings.json file in VSCode.

    0 讨论(0)
  • 2021-01-30 09:41

    Here is a screenshot.

    • Don't forget to escape \
    • You don't have to add it to the Path

    0 讨论(0)
  • 2021-01-30 09:42

    IF using Laragon...Dont forget to change \ to /

      "php.executablePath": "C:/laragon/bin/php/php-7.4.5-Win32-vc15-x64/php.exe",
    
    0 讨论(0)
  • 2021-01-30 09:43

    In my case using XAMPP is like this

    "php.validate.executablePath": "C:/xampp/php/php.exe"
    

    hope that answer your question

    0 讨论(0)
  • 2021-01-30 09:43

    I don't know if this helps but I ran into the same problem with the extension PHP Intelephense in Visual Studio Code. What I did is read the instructions so the extension could work properly. So I disabled PHP Language Features by searching "@builtin PHP" in the extensions. Also, other (3rd party) PHP extensions that provide similar functionality should also be disabled for best results. Finally, I added glob patterns for non-standard PHP file extensions to the files.associations setting. For example: "files.associations": { "*.module": "PHP" }

    Doing this made the error go away. I'm new to PHP too, let me know if this is the correct way of solving this problem with PHP Intelephense.

    0 讨论(0)
提交回复
热议问题