tp6框架验证码加载失败

已经通过composer安装了,tp6的验证码扩展,使用的是phpstudy集成环境

并且开启了gd库,引擎模板也可以使用,但就是在浏览器输出图片裂开。


单独打开http://localhost/captcha.html 界面出现致命错误:

#0 [0]Error in Captcha.php line 181
Call to undefined function think\captcha\imagecreate()
        $this->configure($config);

        $generator = $this->generate();

        // 图片宽(px)
        $this->imageW || $this->imageW = $this->length * $this->fontSize * 1.5 + $this->length * $this->fontSize / 2;
        // 图片高(px)
        $this->imageH || $this->imageH = $this->fontSize * 2.5;
        // 建立一幅 $this->imageW x $this->imageH 的图像
        $this->im = imagecreate($this->imageW, $this->imageH);
        // 设置背景
        imagecolorallocate($this->im, $this->bg[0], $this->bg[1], $this->bg[2]);

        // 验证码字体随机颜色
        $this->color = imagecolorallocate($this->im, mt_rand(1, 150), mt_rand(1, 150), mt_rand(1, 150));

        // 验证码使用随机字体
        $ttfPath = __DIR__ . '/../assets/' . ($this->useZh ? 'zhttfs' : 'ttfs') . '/';

度娘了一番后无果,根据慕课教程实战开发进行学习时,发现讲师并未进行其他设置


是我什么地方遗漏了吗?

在HTML页面加入

{:captcha_img()}

或者

captcha
、 了吗