PHP 개발 버전 문제 처리

藏色散人
풀어 주다: 2023-04-09 16:50:01
앞으로
3701명이 탐색했습니다.
오픈 소스 프로젝트를 설치할 때 작성자는 개발을 위해 로컬에서 PHP 7.1을 사용했고 저는 로컬에서 PHP 7.0을 사용했습니다. 그래서 비극이 발생했고 다음 오류가 발생했습니다. requires php ^7.1 -> your PHP version (7.0.13) does not satisfy that requirement..

一、Composer 安装包

composer install 之后报错

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].
로그인 후 복사

二、解决方法

删除 composer.lock 文件,重新执行 composer install,这样就能重新生成 composer.lock 文件了。

composer 包自动加载后,会生成一个 composer.lock 파일을 잠그므로 GitHub에서 다른 사람의 코드를 가져온 후 이 파일이 필요합니다. 삭제됩니다.

추천: "PHP 비디오 튜토리얼"

위 내용은 PHP 개발 버전 문제 처리의 상세 내용입니다. 자세한 내용은 PHP 중국어 웹사이트의 기타 관련 기사를 참조하세요!

관련 라벨:
원천:segmentfault.com
본 웹사이트의 성명
본 글의 내용은 네티즌들의 자발적인 기여로 작성되었으며, 저작권은 원저작자에게 있습니다. 본 사이트는 이에 상응하는 법적 책임을 지지 않습니다. 표절이나 침해가 의심되는 콘텐츠를 발견한 경우 admin@php.cn으로 문의하세요.
인기 튜토리얼
더>
최신 다운로드
더>
웹 효과
웹사이트 소스 코드
웹사이트 자료
프론트엔드 템플릿
회사 소개 부인 성명 Sitemap
PHP 중국어 웹사이트:공공복지 온라인 PHP 교육,PHP 학습자의 빠른 성장을 도와주세요!