Skip to content

Fix magebox run shadowing PHP wrapper with system PHP on Linux#91

Merged
peterjaap merged 2 commits into
mainfrom
fix/run-path-shadows-php-wrapper
Apr 20, 2026
Merged

Fix magebox run shadowing PHP wrapper with system PHP on Linux#91
peterjaap merged 2 commits into
mainfrom
fix/run-path-shadows-php-wrapper

Conversation

@peterjaap
Copy link
Copy Markdown
Collaborator

@peterjaap peterjaap commented Apr 20, 2026

Summary

  • magebox run prepended /usr/bin to PATH on Linux (via filepath.Dir(version.PHPBinary) where PHPBinary = /usr/bin/php8.2), shadowing ~/.magebox/bin/php and silently running the system PHP instead of the project-pinned version.
  • Prepends ~/.magebox/bin (the wrapper dir) instead — the wrapper already reads .magebox.yaml and execs the correct versioned PHP, so intent is preserved and behavior is consistent across Linux and macOS.

Fixes #90.

Test plan

  • make lint — 0 issues
  • make test — all packages pass
  • Manual: on Linux with system PHP 8.4 and project pinned to PHP 8.2, magebox run <cmd> where <cmd> invokes php bin/magento deploy:mode:set developer resolves to the project PHP and all Magento commands register
  • Manual: same check on macOS — behavior unchanged (still picks the project PHP via the wrapper)

`magebox run` prepended filepath.Dir(version.PHPBinary) to PATH. On Linux
that resolves to /usr/bin — placing the unversioned /usr/bin/php ahead of
~/.magebox/bin/php and silently running the wrong PHP version. When the
system default is a PHP version Magento doesn't support (e.g. 8.4 with
2.4.8-p3), bin/magento degraded to minimal bootstrap mode and commands
like deploy:mode:set were missing.

Prepend ~/.magebox/bin (the wrapper dir) instead. The wrapper already
reads .magebox.yaml and execs the correct PHP binary, matching what
magebox run intends — and it's consistent across Linux and macOS.
@peterjaap peterjaap merged commit 974fc9e into main Apr 20, 2026
9 checks passed
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

Successfully merging this pull request may close these issues.

magebox run shadows ~/.magebox/bin/php wrapper with system PHP on Linux

1 participant