昨天使用5.3.版本的laravel框架开发公司新项目,
发现将cache和session设置为了redis,执行了一下首页访问。
如图:
laravel 版本号:
简单配置一下控制器路由:
Route::get(‘home‘, ‘[email protected]‘);Route::get(‘/‘, ‘[email protected]‘); 访问出现错误!!!说找不到一个类:找不到Class ‘Predis\Client‘ not found 查了查源码,发现少了一个vendor/目录下少了一个包predis,执行:composer require predis/predis 安装这个包就好。注:版本<5.3可以成功解决问题。>5.3的,失败!
控制台错误信息如下:
Updating dependencies (including require-dev)
Failed to decode response: zlib_decode(): data error
Retrying with degraded mode, check https://getcomposer.org/doc/articles/troubleshooting.md#degraded-mode for more info
Your requirements could not be resolved to an installable set of packages.
Problem 1
- The requested package laravel/passport (locked at v1.0.0, required as 1.0.8) is satisfiable by laravel/passport[v1.0.0] but these conf
lict with your requirements or minimum-stability.
Problem 2
- Installation request for laravel/passport 1.0.8 -> satisfiable by laravel/passport[v1.0.8].
- laravel/passport v1.0.8 requires symfony/psr-http-message-bridge ^0.3.0 -> satisfiable by symfony/psr-http-message-bridge[v0.3] but th
ese conflict with your requirements or minimum-stability.
Installation failed, reverting ./composer.json to its original content.
中文翻译:【更新的依赖(包括需要开发)
无法解码的回应:zlib_decode():数据错误
重试与降级模式,检查HTTPS:/ / getcomposer。org /文件/物品/故障排除。MD #降级模式的更多信息
你的要求不可能解决,对包的安装设置。
问题1
-请求的包laravel /护照(锁定在V1.0.0,需通过laravel 1.0.8)/护照[ V1.0.0 ]但这些配置可满足
冲突与您的要求或最小稳定。
问题2
安装要求laravel /护照1.0.8 ->满足由laravel /护照[┊]。
- laravel /护照/ PSR symfony┊需要HTTP消息桥^ 0.3.0┊->满足由symfony / PSR HTTP消息桥[ V0.3 ]但
这些冲突与您的要求或最小稳定。
安装失败,回复到原来的内容。/ composer.json。】
解决方法:[]中括号中为可选项
修改 项目Conposer.json文件 + 删除Conposer.lock +[执行composer clearcace] + [执行composer update] +执行:composer require predis/predis