This package requires php ^7.2.2 but your PHP version (7.1.9)?

vagrant@homestead:~$ php-v
PHP 7.2.2-1+ubuntu16.04.1+deb.sury.org+1 (cli) (built: Feb 1 2018 16:01:26) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
 with Zend OPcache v7.2.2-1+ubuntu16.04.1+deb.sury.org+1, Copyright (c) 1999-2018, by Zend Technologies
 with Zend Server Z-Ray v9.2.0, Copyright (c) period 2004-2017, by Zend Technologies
 with blackfire v1.18.2~linux-x64-non_zts72, https://blackfire.io by SensioLabs


composer.json
"require": {
 "php": "^7.2.2",


ERROR
$ composer install
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

 Problem 1
 - This package requires php ^7.2.2 but your PHP version (7.1.9) does not satisfy that requirement.


Updated Vagrant and Homestead, there is already 7.2 php version, composer.lock removed.

Why else would throw an error, tell me please?
June 7th 19 at 14:33
1 answer
June 7th 19 at 14:35
Solution
perhaps still a problem .env
*based on the advice on Github
https://github.com/laravel/framework/issues/20214#...
https://github.com/laravel/framework/issues/20214#...

Homestead and PHP 7.2 on Board
Faced there with this behavior is the default 7.2, but 7.1
Try to go to dev and the change in the manual version of PHP
sudo update-alternatives --config php
you are prompted with a numbered list of alternatives (in particular, with the path to the actual file) with a proposal to enter the number (from the list) to change the current choice of alternatives, and of PHP-FPM restart

If you ride this option, you will need to add the command in after.sh and write developed what-if...
not helped because my env files are not read and not read because I have the Symphony and the Symphony .env files are not working on vagrant + homestead. Put openserver and will run through Firefox. - jaycee commented on June 7th 19 at 14:38
,
and in the Symphony .env files are not working on vagrant + homestead

not true — work - Mohamed_Lind75 commented on June 7th 19 at 14:41
# This file is a "template" of which env vars need to be defined for your application
# Copy this file to .env file for development, create environment variables when deploying to production
# <a href="https://symfony.com/doc/current/best_practices/configuration.html#infrastructure-related-configuration">https://symfony.com/doc/current/best_practices/configuration.html#infrastructure-related-configuration</a>
# !!! This file is NOT visible if using vagrant / homestead !!!

# App settings
APP_LOG_LEVEL="debug"
APP_URL="http://localhost"
# Security
PASSWORD_PEPPER="testEncodePhRase"


it will read the parameters of the HOMESTEAD instead of the file - jaycee commented on June 7th 19 at 14:44
,
This file is NOT visible if using vagrant / homestead

Wait it's for .env.dist, if it's in .env, the entry is just copied, but has no power
By the way — I have no such lines (Symfony 4)
.env
# This file is a "template" of which env vars need to be defined for your application
# Copy this file to .env file for development, create environment variables when deploying to production
# <a href="https://symfony.com/doc/current/best_practices/configuration.html#infrastructure-related-configuration">https://symfony.com/doc/current/best_practices/configuration.html#infrastructure-related-configuration</a>

###> symfony/framework-bundle ###

Homestead.yml
<img src="https://habrastorage.org/webt/5a/9a/84/5a9a84990368a578215538.png" alt="image">


The Only — Homestead.yml is higher in the folder than the root of the Symfony - Mohamed_Lind75 commented on June 7th 19 at 14:47
tried again to go senonches, update all and check. Homestead 100% is selected and 7.2.2, as well in yml configuration
sites:
 - map: test.app
 to: /home/vagrant/Code/testsite/public
 php: "7.2.2"


but anyway
$ composer install
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

 Problem 1
 - This package requires php ^7.2.2 but your PHP version (7.1.9) does not satisfy that requirement.


composer.lock removed, symfony.lock was also removed. - jaycee commented on June 7th 19 at 14:50
put the complete composer.json - Mohamed_Lind75 commented on June 7th 19 at 14:53
,
1. Run composer clearcache
2. Check for sure, that any of the tabs in the terminal you run the command composer, sometimes for the convenience of programmers start from another tab (I get that), eventually with a local launch :) - Mohamed_Lind75 commented on June 7th 19 at 14:56
in phpstorm console address from the project folder.
BonBon@DESKTOP-DOK1CL5 MINGW64 ~/Code/testsite (master)
$ composer clearcache
Clearing cache (cache-vcs-dir): C:\Users\BonBon\AppData\Local\Composer\vcs
Clearing cache (cache-repo-dir): C:\Users\BonBon\AppData\Local\Composer\repo
Clearing cache (cache-files-dir): C:\Users\BonBon\AppData\Local\Composer\files
Clearing cache (cache-dir): C:\Users\BonBon\AppData\Local\Composer
All caches cleared.

BonBon@DESKTOP-DOK1CL5 MINGW64 ~/Code/testsite (master)
$ composer update
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

 Problem 1
 - This package requires php ^7.2 but your PHP version (7.1.9) does not satisfy that requirement.
- jaycee commented on June 7th 19 at 14:59
,
in phpstorm console address from the project folder.

damn, it's on the dev?
I Windows not working... - Mohamed_Lind75 commented on June 7th 19 at 15:02
Yes , it all decided already. Need to upgrade php on the dev + the configs + on Windows... - jaycee commented on June 7th 19 at 15:05

Find more questions by tags Composer