• notice
  • Congratulations on the launch of the Sought Tech site

Fatal error: Class'think\captcha' not found

Fatal error: Class'think\captcha' not found

The following is the controller code:

use think\captcha\Captcha;

class Index extends Admin

   public function loginAction()
       $captcha = new Captcha();
       $a= $captcha->entry();
       echo $a;exit;

Thinkphp root directory, right-click here to open the command line and execute the following command.

composer require topthink/think-captcha The
official version 5.0 extension library version number is 1.*, and the 2.0 version is dedicated to ThinkPHP5.1.

Simple usage of verification code
Some common usages are defined in the extension package for easy use. The following examples illustrate

Note: URL routing needs to be turned on.

Display of verification code in template


<div><img src="{:captcha_src()}" alt="captcha" /></div>


Technical otaku

Sought technology together

Related Topic


Leave a Reply