Home  >  Article  >  Backend Development  >  Dealing with PHP development version issues

Dealing with PHP development version issues

藏色散人
藏色散人forward
2020-12-02 15:19:263713browse
When installing an open source project, the author used PHP 7.1 locally for development, and I used PHP 7.0 locally, so a tragedy happened, and this error occurred: requires php ^7.1 -> your PHP version (7.0.13) does not satisfy that requirement..

1. Composer installation package

composer install error after

vagrant@homestead:~/Code/sample$ composer install
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Installation request for doctrine/instantiator 1.1.0 -> satisfiable by doctrine/instantiator[1.1.0].
    - doctrine/instantiator 1.1.0 requires php ^7.1 -> your PHP version (7.0.13) does not satisfy that requirement.
  Problem 2
    - doctrine/instantiator 1.1.0 requires php ^7.1 -> your PHP version (7.0.13) does not satisfy that requirement.
    - phpunit/phpunit-mock-objects 2.3.8 requires doctrine/instantiator ^1.0.2 -> satisfiable by doctrine/instantiator[1.1.0].
    - Installation request for phpunit/phpunit-mock-objects 2.3.8 -> satisfiable by phpunit/phpunit-mock-objects[2.3.8].

2. Solution

Delete the composer.lock file and re-execute composer install, so that the composer.lock file can be regenerated. After the

composer package is automatically loaded, a composer.lock lock file will be generated. Therefore, after pulling other people's code from GitHub, this file needs to be deleted.

Recommended: "PHP Video Tutorial"

The above is the detailed content of Dealing with PHP development version issues. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:segmentfault.com. If there is any infringement, please contact admin@php.cn delete