I'm doing preparatory work for upgrading a site from D8 to D9...
The Drupal dev site (macOS 10.14.6 served with Laravel Vagrant) is running PHP 7.3.28, both on command line and php-fpm, and I'm seeing the correct version with php --version and at /admin/reports/status
And yet, whenever I scan my custom modules via the upgrade_status UI, I consistently get:
PHPStan command failed:
/Users/wt/Sites/sitename/vendor/bin/phpstan analyse --error-format=json -c /tmp/upgrade_status/deprecation_testing.neon /Users/wt/Sites/sitename/web/modules/custom/snape 2> /tmp/upgrade_status/phpstan_error_output
Command output:
Empty.
Command error:
Fatal error: Composer detected issues in your platform: Your Composer dependencies require a PHP version ">= 7.3.0". You are running 7.1.33. in /Users/wt/Sites/sitename/vendor/composer/platform_check.php on line 24
If I run phpstan manually using the first command, it works (though annoyingly the JSON output is truncated).
I've been going through this question as well.
- adding
"config": { "platform-check": false }
doesn't work
- adding
"config": { "platform": { "php": "7.4" }
doesn't work
I've checked the user PHP is running as; it's me, the same as via CLI. I've also done which php
version on a bunch of other possible users and they all go to /usr/local/bin/php, which has the correct PHP version.
I've installed drupal/core-dev and phpunit to try and avoid any issues with the upgrade_status module. I have the latest version of it.
It runs correctly on production (Debian 10).