Fix magebox run shadowing PHP wrapper with system PHP on Linux#91
Merged
Conversation
`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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
magebox runprepended/usr/bintoPATHon Linux (viafilepath.Dir(version.PHPBinary)wherePHPBinary = /usr/bin/php8.2), shadowing~/.magebox/bin/phpand silently running the system PHP instead of the project-pinned version.~/.magebox/bin(the wrapper dir) instead — the wrapper already reads.magebox.yamland execs the correct versioned PHP, so intent is preserved and behavior is consistent across Linux and macOS.Fixes #90.
Test plan
make lint— 0 issuesmake test— all packages passmagebox run <cmd>where<cmd>invokesphp bin/magento deploy:mode:set developerresolves to the project PHP and all Magento commands register