ThinkPHP,二、安装验证码插件报错,captch_img()函数不存在的...
<p>错误提示一般为:</p><p class="MsoNormal" align="left"><b><span lang="EN-US" style="font-size:12.0pt;font-family:彩虹粗仿宋;mso-bidi-font-family:MicrosoftYaHei;
color:#525252;mso-font-kerning:0pt">Problem 1<o:p></o:p></span></b></p><p class="MsoNormal" align="left"><b><span lang="EN-US" style="font-size:12.0pt;font-family:彩虹粗仿宋;mso-bidi-font-family:MicrosoftYaHei;
color:#525252;mso-font-kerning:0pt"> -
topthink/think-captcha v3.0.3 requires topthink/framework ^6.0.0 -> satisf<o:p></o:p></span></b></p><p class="MsoNormal" align="left"><b><span lang="EN-US" style="font-size:12.0pt;font-family:彩虹粗仿宋;mso-bidi-font-family:MicrosoftYaHei;
color:#525252;mso-font-kerning:0pt">iable by topthink/framework[6.0.x-dev,
v6.0.0, v6.0.0-rc2, v6.0.0-rc3, v6.0.0-rc<o:p></o:p></span></b></p><p class="MsoNormal" align="left"><b><span lang="EN-US" style="font-size:12.0pt;font-family:彩虹粗仿宋;mso-bidi-font-family:MicrosoftYaHei;
color:#525252;mso-font-kerning:0pt">4, v6.0.0-rc5, v6.0.1, v6.0.2, v6.0.3] but
these conflict with your requirements<o:p></o:p></span></b></p><p class="MsoNormal" align="left"><b><span lang="EN-US" style="font-size:12.0pt;font-family:彩虹粗仿宋;mso-bidi-font-family:MicrosoftYaHei;
color:#525252;mso-font-kerning:0pt"> or
minimum-stability.<o:p></o:p></span></b></p><p class="MsoNormal" align="left"><b><span lang="EN-US" style="font-size:12.0pt;font-family:彩虹粗仿宋;mso-bidi-font-family:MicrosoftYaHei;
color:#525252;mso-font-kerning:0pt"> -
topthink/think-captcha v3.0.2 requires topthink/framework ^6.0.0 -> satisf<o:p></o:p></span></b></p><p class="MsoNormal" align="left"><b><span lang="EN-US" style="font-size:12.0pt;font-family:彩虹粗仿宋;mso-bidi-font-family:MicrosoftYaHei;
color:#525252;mso-font-kerning:0pt">iable by topthink/framework[6.0.x-dev,
v6.0.0, v6.0.0-rc2, v6.0.0-rc3, v6.0.0-rc<o:p></o:p></span></b></p><p class="MsoNormal" align="left"><b><span lang="EN-US" style="font-size:12.0pt;font-family:彩虹粗仿宋;mso-bidi-font-family:MicrosoftYaHei;
color:#525252;mso-font-kerning:0pt">4, v6.0.0-rc5, v6.0.1, v6.0.2, v6.0.3] but
these conflict with your requirements<o:p></o:p></span></b></p><p class="MsoNormal" align="left"><b><span lang="EN-US" style="font-size:12.0pt;font-family:彩虹粗仿宋;mso-bidi-font-family:MicrosoftYaHei;
color:#525252;mso-font-kerning:0pt"> or
minimum-stability.<o:p></o:p></span></b></p><p class="MsoNormal" align="left"><b><span lang="EN-US" style="font-size:12.0pt;font-family:彩虹粗仿宋;mso-bidi-font-family:MicrosoftYaHei;
color:#525252;mso-font-kerning:0pt"> -
topthink/think-captcha v3.0.1 requires topthink/framework ^6.0.0 -> satisf<o:p></o:p></span></b></p><p class="MsoNormal" align="left"><b><span lang="EN-US" style="font-size:12.0pt;font-family:彩虹粗仿宋;mso-bidi-font-family:MicrosoftYaHei;
color:#525252;mso-font-kerning:0pt">iable by topthink/framework[6.0.x-dev,
v6.0.0, v6.0.0-rc2, v6.0.0-rc3, v6.0.0-rc<o:p></o:p></span></b></p><p class="MsoNormal" align="left"><b><span lang="EN-US" style="font-size:12.0pt;font-family:彩虹粗仿宋;mso-bidi-font-family:MicrosoftYaHei;
color:#525252;mso-font-kerning:0pt">4, v6.0.0-rc5, v6.0.1, v6.0.2, v6.0.3] but
these conflict with your requirements<o:p></o:p></span></b></p><p class="MsoNormal" align="left"><b><span lang="EN-US" style="font-size:12.0pt;font-family:彩虹粗仿宋;mso-bidi-font-family:MicrosoftYaHei;
color:#525252;mso-font-kerning:0pt"> or
minimum-stability.<o:p></o:p></span></b></p><p class="MsoNormal" align="left"><b><span lang="EN-US" style="font-size:12.0pt;font-family:彩虹粗仿宋;mso-bidi-font-family:MicrosoftYaHei;
color:#525252;mso-font-kerning:0pt"> -
topthink/think-captcha v3.0.0 requires topthink/framework ^6.0.0 -> satisf<o:p></o:p></span></b></p><p class="MsoNormal" align="left"><b><span lang="EN-US" style="font-size:12.0pt;font-family:彩虹粗仿宋;mso-bidi-font-family:MicrosoftYaHei;
color:#525252;mso-font-kerning:0pt">iable by topthink/framework[6.0.x-dev,
v6.0.0, v6.0.0-rc2, v6.0.0-rc3, v6.0.0-rc<o:p></o:p></span></b></p><p class="MsoNormal" align="left"><b><span lang="EN-US" style="font-size:12.0pt;font-family:彩虹粗仿宋;mso-bidi-font-family:MicrosoftYaHei;
color:#525252;mso-font-kerning:0pt">4, v6.0.0-rc5, v6.0.1, v6.0.2, v6.0.3] but
these conflict with your requirements<o:p></o:p></span></b></p><p class="MsoNormal" align="left"><b><span lang="EN-US" style="font-size:12.0pt;font-family:彩虹粗仿宋;mso-bidi-font-family:MicrosoftYaHei;
color:#525252;mso-font-kerning:0pt"> or
minimum-stability.<o:p></o:p></span></b></p><p class="MsoNormal" align="left"><b><span lang="EN-US" style="font-size:12.0pt;font-family:彩虹粗仿宋;mso-bidi-font-family:MicrosoftYaHei;
color:#525252;mso-font-kerning:0pt"> -
Installation request for topthink/think-captcha ^3.0 -> satisfiable by top<o:p></o:p></span></b></p><p class="MsoNormal" align="left"><b><span lang="EN-US" style="font-size:12.0pt;font-family:彩虹粗仿宋;mso-bidi-font-family:MicrosoftYaHei;
color:#525252;mso-font-kerning:0pt">think/think-captcha[v3.0.0, v3.0.1, v3.0.2,
v3.0.3].</span></b><b><span lang="EN-US" style="font-size:12.0pt;font-family:彩虹粗仿宋;mso-bidi-font-family:MicrosoftYaHei;
color:#525252;mso-font-kerning:0pt"><o:p> </o:p></span></b></p><p>
</p><p class="MsoNormal" align="left"><b><span lang="EN-US" style="font-size:12.0pt;font-family:彩虹粗仿宋;mso-bidi-font-family:MicrosoftYaHei;
color:#525252;mso-font-kerning:0pt">Installation failed, reverting
./composer.json to its original content.</span></b></p><p><b><br></b></p><p><b><br></b></p><p>解决方法:</p><p class="MsoNormal" align="left"><span lang="EN-US"><a href="https://www.cnblogs.com/ryanzheng/p/12337301.html"><span style="font-size: 12pt; font-family: 彩虹粗仿宋; color: rgb(82, 82, 82);">Composer
</span><span lang="EN-US" style="font-size: 12pt; font-family: 彩虹粗仿宋; color: rgb(82, 82, 82);"><span lang="EN-US">安装 topthink/think-captcha </span></span><span lang="EN-US" style="font-size: 12pt; font-family: 彩虹粗仿宋; color: rgb(82, 82, 82);"><span lang="EN-US">时报错 requires topthink/framework ^6.0.0</span></span><span style="font-size: 12pt; color: rgb(82, 82, 82);"> </span></a></span><span lang="EN-US" style="font-size:12.0pt;font-family:彩虹粗仿宋;mso-bidi-font-family:MicrosoftYaHei;
color:#525252;mso-font-kerning:0pt"><o:p></o:p></span></p><p></p><p class="MsoNormal" align="left"><span style="font-size:12.0pt;font-family:彩虹粗仿宋;
mso-bidi-font-family:MicrosoftYaHei;color:#525252;mso-font-kerning:0pt">当我们使用命令<span lang="EN-US"> composer require topthink/think-captcha</span>下载验证码库时,默认下载最新版本,当前最新版本是<span lang="EN-US">3.0</span>,<span lang="EN-US"><o:p></o:p></span></span></p><p class="MsoNormal" align="left"><span lang="EN-US" style="font-size:12.0pt;font-family:
彩虹粗仿宋;mso-bidi-font-family:MicrosoftYaHei;color:#525252;mso-font-kerning:0pt">3.0</span><span style="font-size:12.0pt;font-family:彩虹粗仿宋;mso-bidi-font-family:MicrosoftYaHei;
color:#525252;mso-font-kerning:0pt">版本是为<span lang="EN-US"> ThinkPHP 6 </span>准备的,所以我们需要下载<span lang="EN-US"> 2.0 </span>版本验证码库,<span lang="EN-US">2.0 </span>版本的才是为<span lang="EN-US"> ThinkPHP5.1 </span>准备的,<span lang="EN-US"><o:p></o:p></span></span></p><p class="MsoNormal" align="left"><span style="font-size:12.0pt;font-family:彩虹粗仿宋;
mso-bidi-font-family:MicrosoftYaHei;color:#525252;mso-font-kerning:0pt">所以我们只要使用<span lang="EN-US"> composer </span>命令下载验证码库的时候指定版本号即可<span lang="EN-US"><o:p></o:p></span></span></p><p class="MsoNormal" align="left"><span lang="EN-US" style="font-size:12.0pt;font-family:
彩虹粗仿宋;mso-bidi-font-family:MicrosoftYaHei;color:#525252;mso-font-kerning:0pt">composer
require topthink/think-captcha=2.* <o:p></o:p></span></p><p class="MsoNormal" align="left"><span lang="EN-US" style="font-size:12.0pt;font-family:
彩虹粗仿宋;mso-bidi-font-family:MicrosoftYaHei;color:#525252;mso-font-kerning:0pt"><o:p> </o:p></span></p><p class="MsoNormal" align="left"><span style="font-size:12.0pt;font-family:彩虹粗仿宋;
mso-bidi-font-family:MicrosoftYaHei;color:#525252;mso-font-kerning:0pt">如果你使用的是<span lang="EN-US"> TP 5.0.* </span>的版本,直接运行上面的安装命令还是会报错,最直接的方法就是去<span lang="EN-US">
packagist </span>网站查看该代码包对应的<span lang="EN-US"> tp </span>版本,然后安装对应的版本即可<span lang="EN-US"><o:p></o:p></span></span></p><p>
</p><p class="MsoNormal" align="left"><span style="font-size:12.0pt;font-family:彩虹粗仿宋;
mso-bidi-font-family:MicrosoftYaHei;color:#525252;mso-font-kerning:0pt">我当前的<span lang="EN-US"> TP </span>版本为 <span lang="EN-US">5.0.24</span>,则可以安装<span lang="EN-US">
think-captcha=1.*即安装命令为:<o:p></o:p></span></span></p><p class="MsoNormal" align="left"><span style="color: rgb(82, 82, 82); font-family: 彩虹粗仿宋;">composer require topthink/think-captcha=1.*</span><span style="font-size:12.0pt;font-family:彩虹粗仿宋;
mso-bidi-font-family:MicrosoftYaHei;color:#525252;mso-font-kerning:0pt"><span lang="EN-US"><br></span></span></p>
页:
[1]