vscode-phpserver
vscode-phpserver copied to clipboard
php not found
Issue Type: Feature Request
php not found
Extension version: 3.0.2 VS Code version: Code 1.56.2 (054a9295330880ed74ceaedda236253b4f39a335, 2021-05-12T17:13:13.157Z) OS version: Windows_NT x64 10.0.19042
I had the same problem. Try pressing Ctrl+, to open your settings, then search for phpserver.phpPath and put in the path of your php executable. Can't remember if I had to reload VS Code after.
Having the same exact issue. I can confirm that my php.exe is working due to other extensions using it (and version checking it multiple times). I changed my settings.json file to include all of this just to be super sure:
"php.validate.executablePath": "C:\xampp\php\php.exe", "php.executablePath": "C:\xampp\php\php.exe", "phpserver.phpPath": "C:\xampp\php\php.exe",
I tried making them all the surrounding folder rather than the .exe itself, enabled and disabled all builtin PHP functionality in VSCode, and still nothing. No matter how many times I restart or change things I can't get the server to recognize php.exe. I even installed PHP separately and tried using that .exe instead with no luck. Any ideas?
The backslashes need to be escaped in the json file. Does your file look like the first line in this image or the second line?
If I don't have the backslashes escaped, parts of the string show in different colors, but when I add the escape characters, it all changes to one color (I'm using the Dark+ (default dark) theme, strings in json show as orange). If yours looks like the top line, try adding the escape characters and see if it helps. It is possible that you've set up a different escape character for json, but \ is the default.
I have had the characters escaped in my settings.json file since I started troubleshooting, still gives me the same error message every time. Any other ideas as to what I could be doing wrong?
PHP not found.
I have tried just about every possible setting as well. I hope the author is viewing these comments.
i have this issue now, it worked before but now it says php not found?
Did anyone manage to solve this? I have the same problem with Ubuntu.
Running this command in the terminal worked for me (Ubuntu user)
sudo apt-get install php
Ofcourse php needs to be installed. I solved the issue by installing visual studio using the command line, instead of via the software center. I could set the path "/usr/bin/php" correct without having to disable the PHP features app.
Hello everyone, I had the same issue and the problem was that I specified the path in settings.json within the code runner extension and not for the whole vscode. Check to see if you accidentally wrote it in the wrong place too
required Visual Studio C++ for PHP [Visual Studio C++]
https://learn.microsoft.com/pt-br/cpp/windows/latest-supported-vc-redist?view=msvc-170
x64 https://aka.ms/vs/17/release/vc_redist.x64.exe