评论

使用开源PHP版本与本地版本不同的处理办法

[使用开源PHP版本与本地版本不同的处理办法]删除 composer.lock 文件,重新执行 composer install,这样就能重新生成 composer.lock 文件了。

一、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
https://www.qilucms.com /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 https://www.why114.com 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拉取别人的代码后,需要对这个文件进行删除。

点赞 0
收藏
评论
登录 后发表内容