Closed manuelm closed 7 months ago
I'm not sure this will work as expected:
PHP_BINARY
should always return the binary that is currently executed – so that would already be "known"?PHP_BINARY
constant would bypass the version check in your PR, that looks wrong to me. But maybe I'm overlooking something? 🤔
- according to the docs,
PHP_BINARY
should always return the binary that is currently executed – so that would already be "known"?
In general and most setups, yes. The detected path and PHP_BINARY
should match. However if the path to the executable has been silently rewritten there is a mismatch. Because we are storing the detected path instead of the path the php-cli provides, this mismatch might result in execution failure as soon as the path-rewriting does not happen anymore. e.g. the rewriting only happens if execution happens from a website, but php-cli from cron/ssh does not.
- "having" a
PHP_BINARY
constant would bypass the version check in your PR, that looks wrong to me. But maybe I'm overlooking something? thinking
I'm not sure I follow. There are no further checks which examine $path
?
While searching the PHP cli path we use the first path which produces a valid result. However some hosters are re-writing exec paths, so the wrong (and possibly non-existent) path to the PHP cli ends in our configuration.
Instead of taking the path as-is we should rather use the path the PHP cli provides (PHP_BINARY).