composer require nmred/kafka-php
报错:
[root@localhost total_smp]# composer require nmred/kafka-php
Using version v0.2.0.8 for nmred/kafka-php
./composer.json has been updated
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
- Can only install one of: psr/log[1.1.0, 1.0.2].
- Can only install one of: psr/log[1.0.2, 1.1.0].
- Can only install one of: psr/log[1.0.2, 1.1.0].
- nmred/kafka-php v0.2.0.8 requires psr/log 1.0.2 -> satisfiable by psr/log[1.0.2].
- Installation request for nmred/kafka-php v0.2.0.8 -> satisfiable by nmred/kafka-php[v0.2.0.8].
- Installation request for psr/log (locked at 1.1.0) -> satisfiable by psr/log[1.1.0].
Installation failed, reverting ./composer.json to its original content.
解决:
提示说nmred/kafka-php v0.2.0.8 需要 psr/log 1.0.2版本,安装psr/log 1.0.2或者psr/log降级到1.0.2(此过程需要提前斟酌psr/log 1.0.2是否与项目其他扩展冲突)
[root@localhost total_smp]# composer require psr/log 1.0.2
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 0 installs, 1 update, 0 removals
- Downgrading psr/log (1.1.0 => 1.0.2): Downloading (100%)
Writing lock file
Generating optimized autoload files
Illuminate\Foundation\ComposerScripts::postAutoloadDump
@php artisan package:discover --ansi
Discovered Package: beyondcode/laravel-dump-server
Discovered Package: fideloper/proxy
Discovered Package: hhxsv5/laravel-s
Discovered Package: intervention/image
Discovered Package: laravel/tinker
Discovered Package: maatwebsite/excel
Discovered Package: mews/captcha
Discovered Package: nesbot/carbon
Discovered Package: nunomaduro/collision
Package manifest generated successfully.
安装nmred/kafka-php
[root@localhost total_smp]# composer require nmred/kafka-php
Using version v0.2.0.8 for nmred/kafka-php
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 2 installs, 0 updates, 0 removals
- Installing amphp/amp (v1.2.2): Downloading (100%)
- Installing nmred/kafka-php (v0.2.0.8): Downloading (100%)
Writing lock file
Generating optimized autoload files
Illuminate\Foundation\ComposerScripts::postAutoloadDump
@php artisan package:discover --ansi
Discovered Package: beyondcode/laravel-dump-server
Discovered Package: fideloper/proxy
Discovered Package: hhxsv5/laravel-s
Discovered Package: intervention/image
Discovered Package: laravel/tinker
Discovered Package: maatwebsite/excel
Discovered Package: mews/captcha
Discovered Package: nesbot/carbon
Discovered Package: nunomaduro/collision
Package manifest generated successfully.