按照webman手册的描述安装了blade模板引擎后,在安装数据库就报错了
composer require -W psr/container ^1.1.1 illuminate/database illuminate/pagination illuminate/events symfony/var-dumper
Using version ^9.40 for illuminate/database
Using version ^9.40 for illuminate/pagination
Using version ^9.40 for illuminate/events
Using version ^6.0 for symfony/var-dumper
./composer.json has been updated
Running composer update psr/container illuminate/database illuminate/pagination illuminate/events symfony/var-dumper --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
- illuminate/view v8.83.26 requires illuminate/collections ^8.0 -> found illuminate/collections[v8.0.0, ..., v8.83.26] but it conflicts with another require.
- jenssegers/blade v1.4.0 requires illuminate/view ^5.5|^6.0|^7.0|^8.0 -> satisfiable by illuminate/view[v8.83.26].
- jenssegers/blade is locked to version v1.4.0 and an update of this package was not requested.
Use the option --with-all-dependencies (-W) to allow upgrades, downgrades and removals for packages currently locked to specific versions.
Installation failed, reverting ./composer.json and ./composer.lock to their original content.
这里写具体的系统环境相关信息
win10
composer.json
{
"name": "workerman/webman",
"type": "project",
"keywords": [
"high performance",
"http service"
],
"homepage": "https://www.workerman.net",
"license": "MIT",
"description": "High performance HTTP Service Framework.",
"authors": [
{
"name": "walkor",
"email": "walkor@workerman.net",
"homepage": "https://www.workerman.net",
"role": "Developer"
}
],
"support": {
"email": "walkor@workerman.net",
"issues": "https://github.com/walkor/webman/issues",
"forum": "https://wenda.workerman.net/",
"wiki": "https://workerman.net/doc/webman",
"source": "https://github.com/walkor/webman"
},
"require": {
"php": ">=7.2",
"workerman/webman-framework": "^1.4.3",
"monolog/monolog": "^2.0",
"psr/container": "1.1.1",
"jenssegers/blade": "~1.4.0"
},
"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"
]
}
}
先把blade模版卸载
composer remove jenssegers/blade
,装完数据库再装blade试下我重新安装了一次,这次先安装的数据库,正常,然后安装blade,报错了:
composer require psr/container ^1.1.1 jenssegers/blade:~1.4.0
提示:
./composer.json has been updated
Running composer update psr/container jenssegers/blade
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.
Problem 1
illuminate/view[v5.5.0, ..., v5.5.44] require illuminate/container 5.5.* -> found illuminate/container[v5.5.0, ..., v5.5.44] but the package is fixed to v9.41.0 (lock file version) by a partial update and that version does not match. Make sure you list it as an argument for the update command.
illuminate/view[v5.6.0, ..., v5.8.36] require php ^7.1.3 -> your php version (8.0.2) does not satisfy that requirement.
illuminate/view[v6.0.0, ..., v6.19.1] require php ^7.2 -> your php version (8.0.2) does not satisfy that requirement.
illuminate/view[v6.20.0, ..., v6.20.44] require illuminate/container ^6.0 -> found illuminate/container[v6.0.0, ..., v6.20.44] but the package is fixed to v9.41.0 (lock file version) by a partial update and that version does not match. Make sure you list it as an argument for the update command.
illuminate/view[v7.0.0, ..., v7.28.4] require php ^7.2.5 -> your php version (8.0.2) does not satisfy that requirement.
illuminate/view[v7.29.0, ..., v7.30.6] require illuminate/container ^7.0 -> found illuminate/container[v7.0.0, ..., v7.30.6] but the package is fixed to v9.41.0 (lock file version) by a partial update and that version does not match. Make sure you list it as an argument for the update command.
illuminate/view[v8.0.0, ..., v8.11.2] require php ^7.3 -> your php version (8.0.2) does not satisfy that requirement.
illuminate/view[v8.12.0, ..., v8.83.26] require illuminate/collections ^8.0 -> found illuminate/collections[v8.0.0, ..., v8.83.26] but the package is fixed to v9.41.0 (lock file version) by a partial update and that version does not match. Make sure you list it as an argument for the update command.
jenssegers/blade v1.4.0 requires illuminate/view ^5.5|^6.0|^7.0|^8.0 -> satisfiable by illuminate/view[v5.5.0, ..., v5.8.36, v6.0.0, ..., v6.20.44, v7.0.0, ..., v7.30.6, v8.0.0, ..., v8.83.26].
Root composer.json requires jenssegers/blade ~1.4.0 -> satisfiable by jenssegers/blade[v1.4.0].
Use the option --with-all-dependencies (-W) to allow upgrades, downgrades and removals for packages currently locked to specific versions.
Installation failed, reverting ./composer.json and ./composer.lock to their original content.
composer.lock 删掉,再安装
删除了composer.lock,再运行结果还是一样
用这个吧
composer require webman/blade
🐂🐃
(wb2是项目文件名)用composer require webman/blade安装之后,没报错了,运行出现了这个报错
Error: Call to undefined method Illuminate\Container\Container::terminating() in F:\2022www\webman\wb2\vendor\illuminate\view\ViewServiceProvider.php:26
Stack trace:
0 F:\2022www\webman\wb2\vendor\webman\blade\src\Blade.php(39): Illuminate\View\ViewServiceProvider->register()
1 F:\2022www\webman\wb2\vendor\workerman\webman-framework\src\support\view\Blade.php(56): Jenssegers\Blade\Blade->__construct()
2 F:\2022www\webman\wb2\support\helpers.php(192): support\view\Blade::render()
3 F:\2022www\webman\wb2\app\controller\IndexController.php(11): view()
4 F:\2022www\webman\wb2\vendor\workerman\webman-framework\src\App.php(284): app\controller\IndexController->index()
5 F:\2022www\webman\wb2\vendor\workerman\webman-framework\src\App.php(147): Webman\App::Webman{closure}()
6 F:\2022www\webman\wb2\vendor\workerman\workerman\Connection\TcpConnection.php(638): Webman\App->onMessage()
7 F:\2022www\webman\wb2\vendor\workerman\workerman\Events\Select.php(311): Workerman\Connection\TcpConnection->baseRead()
8 F:\2022www\webman\wb2\vendor\workerman\workerman\Worker.php(2467): Workerman\Events\Select->loop()
9 F:\2022www\webman\wb2\vendor\workerman\workerman\Worker.php(1453): Workerman\Worker->run()
10 F:\2022www\webman\wb2\vendor\workerman\workerman\Worker.php(1396): Workerman\Worker::forkWorkersForWindows()
11 F:\2022www\webman\wb2\vendor\workerman\workerman\Worker.php(560): Workerman\Worker::forkWorkers()
12 F:\2022www\webman\wb2\vendor\workerman\webman-framework\src\support\App.php(124): Workerman\Worker::runAll()
13 F:\2022www\webman\wb2\start.php(4): support\App::run()
14 {main}
可能哪里不兼容,这个定位需要时间。
如果你php版本可以切换,可以用php7,php7下 Illuminate/database 和 jenssegers/blade 之间没有冲突
目前环境用的是php8,一时还不会用到视图,以后每天过来看一遍,等问题修复,谢谢前辈
已经解决
composer require webman/blade ^1.5.1
本地安装测试了一下,没有冲突了。谢谢前辈周末还加班帮我修复问题
复用composer组件是正确的方向,否则每个框架都出一个自己的数据库 redis等各种轮子,即浪费时间,又容易出bug,增加了php开发者学习负担,对php社区也是一种割裂。
如果有个别composer组件有问题,webman官方会fork一份自己维护。目前fork了一份webman/blade, 截图中laravel-orm9 view不能同时安装的问题也解决了。
目前composer组件遇到的问题基本上是依赖php版本低和其他组件的版本过低问题,fork一份稍微修改下composer.json就解决了。
老大辛苦了,我去把
webman/blade
转发回复过去!🐂