ThinkPHP 5.1 安装图形验证码的时候报错:

composer require topthink/think-captcha

Composer 安装 topthink/think-captcha 时报错 requires topthink/framework ^6.0.0 【已解决】

 

 

出错原因:


当我们使用命令 composer require topthink/think-captcha下载验证码库时,默认下载最新版本,当前最新版本是3.0,

3.0版本是为 ThinkPHP 6 准备的,所以我们需要下载 2.0 版本验证码库,2.0 版本的才是为 ThinkPHP5.1 准备的,

所以我们只要使用 composer 命令下载验证码库的时候指定版本号即可

composer require topthink/think-captcha=2.*

 

如果你使用的是 TP 5.0.* 的版本,直接运行上面的安装命令还是会报错,最直接的方法就是去 packagist 网站查看该代码包对应的 tp 版本,然后安装对应的版本即可

例如:我当前的 TP 版本为 5.0.24,则可以安装 think-captcha=1.*

Composer 安装 topthink/think-captcha 时报错 requires topthink/framework ^6.0.0 【已解决】

 

 

https://packagist.org/packages/topthink/think-captcha#v1.0.8

相关文章:

  • 2021-11-23
  • 2021-09-01
  • 2022-12-23
  • 2018-10-28
  • 2021-12-15
  • 2021-05-02
  • 2021-05-23
  • 2021-12-26
猜你喜欢
  • 2021-06-10
  • 2022-12-23
  • 2021-08-16
  • 2021-11-29
  • 2022-12-23
  • 2021-04-30
  • 2021-07-06
相关资源
相似解决方案