-
Notifications
You must be signed in to change notification settings - Fork 28.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
VSCode keeps pointing to wrong executables especially PHP Executables, works perfectly in regular mac terminal #131534
Comments
(Experimental duplicate detection) |
I'm having this same issue. Steps to reproduce1. Install Homebrew PHP
2. Restart computer3. Check PHP executable and version in iTerm and Terminal.appBoth have the same output:
Both apps use the Homebrew executable. 4. Check PHP executable and version in vscode integrated terminal
vscode is using the system PHP. System
Extensions
(1 theme extensions excluded) A/B Experimentsvsliv695:30137379 |
I'm also having this issue on a fresh install of MacOS 11.5.2 and VSCode 1.59.0 (Universal) on an M1 Mac Mini. I have various versions of PHP installed via Homebrew and I'm switching between them (linking/unlinking) with the Laravel Valet In the Mac terminal and iTerm2 the currently linked version of PHP is respected, but in the VSCode terminal it is not, it always loads the bundled MacOS PHP instead. To fix this I am manually exporting the path to the correct PHP in ~/.zshrc, like so:
This works, but obviously it's a pain as I have to update this path whenever I switch the PHP version. Anyone have a more permanent fix!? |
Yes I have managed to fix it by adding PHP to the path. But this does not seem like a clean solution as you suggested, because whenever we update PHP this needs to be done manually. VSCode seems to pickup the OpenJDK I have added with Homebrew but somehow not PHP There should be a cleaner way to tell VSCode to point to the right executable Why is executablePath & validate.executablePath not working I have no idea |
See https://code.visualstudio.com/docs/editor/integrated-terminal#_why-are-there-duplicate-paths-in-the-terminals-path-environment-variable-andor-why-are-they-reversed for an explanation and how to fix this issue |
Thanks a ton @Tyriar. Setting |
Issue Type: Bug
It seems like ever since I upgraded my macos to Big Sur 11.5.2 I have been struggling to use the terminal properly.
I have created this question on stackoverflow: https://stackoverflow.com/questions/68899144/wrong-php-version-executable-in-vscode-terminal-but-works-perfectly-in-mac-termiFatal
I have tried everything, updated the executablePath, the validate.executablePath, completely reinstalled VSCode and done everything, nothing works.
This is a very strange bug as everything works perfectly in the regular terminal.
With PHP for example I have PHP 8.0.9 installed with brew and is in /opt/homebrew/bin/php but VSCode keeps pointing to /usr/bin/php which has the old mac version of php.
When I try to do PHP commands in a symfony project I get the following error:
error: Composer detected issues in your platform: Your Composer dependencies require a PHP version ">= 8.0.0". You are running 7.3.24-(to be removed in future macOS)
When I try to do unit tests in PHPUnit I get the following error:
/usr/bin/php declares an invalid value for PHP_VERSION.
This breaks fundamental functionality such as version_compare().
Please use a different PHP interpreter.
I am banging my head against the wall for days and I am not sure how to set this up properly.
Please do not just answer something generic and close this question without discussion as i have tried everything imaginable
Any advice would be appreciated
VS Code version: Code 1.59.1 (3866c35, 2021-08-19T11:57:20.140Z)
OS version: Darwin arm64 20.6.0
Restricted Mode: No
System Info
gpu_compositing: enabled
metal: disabled_off
multiple_raster_threads: enabled_on
oop_rasterization: enabled
opengl: enabled_on
rasterization: enabled
skia_renderer: disabled_off_ok
video_decode: enabled
webgl: enabled
webgl2: enabled
Extensions (25)
A/B Experiments
The text was updated successfully, but these errors were encountered: