I have a dev-server where multiple sites are running in development. Most of them use php8.1
Now for a new project I wanted to run php8.2
According to this answer https://stackoverflow.com/a/54736948/12848667 and several blog posts I found on the internet, I set my composer to a specific php version. But it does not seem to work.
In composer.json:
"config": {
"optimize-autoloader": true,
"prepend-autoloader": false,
"platform": {
"php": "8.2"
}
},
"scripts": {
"php-version": "composer -vvv about"
},
But the output of "php-version" still shows 8.1
$ composer php-version
> composer -vvv about
Running 2.4.4 (2022-10-27 14:39:29) with PHP 8.1.18 on Linux / 5.10.0-22-amd64
what am I missing?
Edit: php8.2 is installed in fpm and cli version
$ which php8.2
/usr/bin/php8.2