按照官方的文档安装 psr/container ^v1 和 jenssegers/blade ~1.4.0后再安装illuminate/database,始终不成功,报错:
composer require -W illuminate/database illuminate/pagination illuminate/events
Using version ^9.12 for illuminate/database
Using version ^9.12 for illuminate/pagination
Using version ^9.12 for illuminate/events
./composer.json has been updated
Running composer update illuminate/database illuminate/pagination illuminate/events --with-all-dependencies
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.
Problem 1
You can also try re-running composer require with an explicit version constraint, e.g. "composer require illuminate/database:*" to figure out if any version is installable, or "composer require illuminate/database:^2.1" if you know which you need.
Installation failed, reverting ./composer.json and ./composer.lock to their original content.
系统:windows 11
PHP: 8.1.2
Composer: 2.3.5
composer.json如下
"require": {
"php": ">=7.2",
"workerman/webman-framework": "^1.3.13",
"monolog/monolog": "^3.0.0",
"psr/container": "v1",
"jenssegers/blade": "^1.4"
},
"suggest": {
"ext-event": "For better performance. "
},
"autoload": {
"psr-4": {
"": "./",
"App\\": "./app"
},
"files": [
"./support/helpers.php"
]
},
"scripts": {
"post-package-install": [
"support\\Plugin::install"
],
"post-package-update": [
"support\\Plugin::install"
],
"pre-package-uninstall": [
"support\\Plugin::uninstall"
]
}
貌似是跟psr/container ^v1 jenssegers/blade ~1.4.0 冲突!!!!
各种版本间冲突太折磨人了。。
肿么办啊???
下面的两个扩展版本。
我安装的是这个版本。
php8.0.8 版。
composer info 如下:
看来还是illuminate的靠谱,虽然没有解决我的问题
你用blade 视图了吗?用的哪个依赖什么版本?
没用blade,用的是php原生语法作为模版。
我也用php原生语法,可是没有模板继承,这点让我很不爽
include 呵呵。
按照提示加个-W参数试下,
composer require -W illuminate/database illuminate/pagination illuminate/events
没能解决~~
再按照提示
composer require illuminate/database:*
这样是可以,就放弃9版本了,就没有以后了~ -_-||
如果安装了psr/container ^v1 和 jenssegers/blade ~1.4.0, illuminate/redis也同样安装不了
强烈建议放弃拥抱jenssegers/blade吧,它已经不更新了
我的终极解决方案:
用 standalone-blade(https://github.com/ryangjchandler/standalone-blade )取代了jenssegers/blade。供大家参考~