-
Notifications
You must be signed in to change notification settings - Fork 131
Description
Preconditions
- Magento 2.4.7 on Adobe Commerce Cloud
- MFTF 4.7.5
- Running tests from local against cloud environment
- Tests use
<magentoCLI>actions
Steps to reproduce
- Deploy to Adobe Commerce Cloud
- Run
vendor/bin/mftf build:project - Run
vendor/bin/mftf doctoror any test with<magentoCLI>action
Expected result
Magento CLI commands execute successfully via command.php endpoint.
Actual result
HTTP 403: "Given command not found valid in Magento CLI Command list."
Root cause: Line 22 in command.php:
$php = PHP_BINDIR ? PHP_BINDIR . '/php' : 'php';On Magento Cloud, PHP_BINDIR points to /usr/bin/php which is an incompatible PHP version. The correct PHP 8.3 is available via php in PATH, but the code never falls back to it because PHP_BINDIR is always set.
This is similar to issue #216 (PHP-FPM), which was fixed in PR #217 by switching from PHP_BINARY to PHP_BINDIR. That fixed PHP-FPM but broke Magento Cloud.
Simple fix: Make the PHP binary configurable in .env:
$php = $_ENV['MFTF_PHP_BINARY'] ?? (PHP_BINDIR ? PHP_BINDIR . '/php' : 'php');Then users can set MFTF_PHP_BINARY=php in .env for cloud environments.
Currently, we have to manually edit the file after every build:project, which isn't sustainable.