Skip to content
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

VS Code + PHP on macOS Big Sur 11.2.1 - issues with default interpreter #516

Closed
tuck1s opened this issue Mar 1, 2021 · 1 comment
Closed

Comments

@tuck1s
Copy link

tuck1s commented Mar 1, 2021

Issue Type: Bug

  1. Start with PHP 7.4.8 in /usr/local/bin. $PATH has this listed first, rather than the macOS default.
which -a php                       
/usr/local/bin/php
/usr/bin/php
  1. Install VSCode PHP extension and xdebug extension
  2. Install xdebug following the "wizard" advice
  3. Amend /usr/local/etc/php/7.4/php.ini file to enable xdebug:
zend_extension = /usr/local/lib/php/pecl/20190902/xdebug.so
xdebug.mode = debug
xdebug.start_with_request = yes
  1. Start VS Code. Confirm in Terminal window that the debugger is active.
php -v
PHP 7.4.8 (cli) (built: Jul 30 2020 02:10:12) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
    with Xdebug v3.0.3, Copyright (c) 2002-2021, by Derick Rethans
    with Zend OPcache v7.4.8, Copyright (c), by Zend Technologies
  1. Run phpinfo() in a test script. Output shows
phpinfo()
PHP Version => 7.3.24-(to be removed in future macOS)

which of course doesn't have xdebug active, so stepping etc. doesn't work.

  1. Workaround: edit launch.json. Edit the "Launch currently open script" section. Add
            "runtimeExecutable": "/usr/local/bin/php",
  1. VS Code then runs the correct PHP version.

Extension version: 1.14.9
VS Code version: Code 1.53.2 (622cb03f7e070a9670c94bae1a45d78d7181fbd4, 2021-02-11T11:45:54.515Z)
OS version: Darwin x64 20.3.0

System Info
Item Value
CPUs Intel(R) Core(TM) i7-4870HQ CPU @ 2.50GHz (8 x 2500)
GPU Status 2d_canvas: enabled
gpu_compositing: enabled
metal: disabled_off
multiple_raster_threads: enabled_on
oop_rasterization: enabled
opengl: enabled_on
protected_video_decode: unavailable_off
rasterization: enabled
skia_renderer: disabled_off_ok
video_decode: enabled
webgl: enabled
webgl2: enabled
Load (avg) 2, 2, 3
Memory (System) 16.00GB (0.54GB free)
Process Argv --crash-reporter-id 32a33cc6-f35a-4159-a5a0-68ec1a950bc7
Screen Reader no
VM 0%
A/B Experiments
vsliv368:30146709
vsreu685:30147344
python383cf:30185419
vspor879:30202332
vspor708:30202333
vspor363:30204092
pythonvsdeb440:30248342
pythonvsded773:30248341
vstes627:30244334
pythonvspyt875:30259475
pythontb:30265425

@zobo
Copy link
Contributor

zobo commented May 23, 2022

This was fixed in #706 Please see #705 for more detailed explanation what was happening.

@zobo zobo closed this as completed May 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants