在安装一个开源项目时,作者本地用了 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 installLoading composer repositories with package informationInstalling dependencies (including require-dev) from lock fileYour 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视频教程》

更多相关文章

  1. php实现断点续传大文件
  2. 一个查看xhprof数据文件的docker镜像
  3. 教你用php读写csv格式的文件
  4. web安全之文件上传漏洞攻击与防范方法
  5. 使用file_get_contents()函数读取文件内容
  6. php文件后缀名是什么

随机推荐

  1. golang怎么导入包
  2. golang检查文件是否存在的方法
  3. golang能开发什么?
  4. golang最适合做什么项目
  5. golang如何编译
  6. golang导出csv乱码解决方法
  7. golang 乱码怎么解决
  8. golang判断字符串是否为空的方法
  9. golang怎么生成随机数
  10. golang 开源吗