I'm trying to install spatie/laravel-medialibrary-pro:^2.0.0 but hitting the error "- spatie/laravel-medialibrary-pro 2.0.0 requires php ^8.0 which does not match your installed version 7.4.14."
My IDE is phpstorm which is using PHP 8.1. My composer.json requires php 8.1
I think I can work around the problem by using "composer install --ignore-platform-reqs" but I'd prefer to understand why I'm hitting the problem. All thoughts are appreciated!
It probably depends on your development environment.
Laravel Homestead
If you're using Laravel Homestead, you can change PHP version in different ways:
php81
. This will change the default CLI version for all applications installed in the Virtual MachineHomestead.yml
Laravel Sail
If you're using Laravel Sail, you should update the build definition of the your-site.test container in your application's docker-compose.yml file:
Custom setup
In any other case, it will depend on how your local env is setup. Try running
php -v
to figure out what version the CLI is using.