-- 创造无限可能

php安装JWT库报错:Problem 1 - lcobucci/jwt is locked to version 4.2.1 and an update of this package was not requested. - lcobucci/jwt 4.2.1 requires ext-sodium * -> it is missing from your system. Install or enable PHP's sodium extension.

2022-11-11 17:28:23
684 人浏览 3 人点赞
有用,点赞支持一下

报错信息

安装lcobucci/jwt报错,报错信息如下

Problem 1
    - Root composer.json requires lcobucci/jwt ^4.1 -> satisfiable by lcobucci/jwt[4.1.0, ..., 4.2.1].
    - lcobucci/jwt[4.1.0, ..., 4.2.1] require ext-sodium * -> it is missing from your system. Install or enable PHP's sodium extension.

To enable extensions, verify that they are enabled in your .ini files:
    - /php/php-7.4.0/etc/php.ini

问题分析

lcobucci/jwt依赖ext-sodium拓展,但是系统不存在ext-sodium拓展,导致安装失败

问题处理

方法一:安装sodium拓展
打开/php/php-7.4.0/etc/php.ini配置文件,检查是否开启了sodium拓展

extension=sodium #去掉前面的分号

方法二:安装lcobucci/jwt的 3.4版本