美文网首页
composer require topthink/think-

composer require topthink/think-

作者: 大笨蛋就是我呀 | 来源:发表于2019-01-27 13:26 被阅读0次

    在安装验证码功能时,执行composer require topthink/think-captcha,我报出了如下错误

    Failed to execute unzip -qq '/var/www/html/tp5/vendor/topthink/think-captcha/546f7592b7e0bd74c45a7b9a2780873d' -d '/var/www/html/tp5/vendor/composer/b722ed6a'

    [/var/www/html/tp5/vendor/topthink/think-captcha/546f7592b7e0bd74c45a7b9a2780873d]

      End-of-central-directory signature not found.  Either this file is not

      a zipfile, or it constitutes one disk of a multi-part archive.  In the

      latter case the central directory and zipfile comment will be found on

      the last disk(s) of this archive.

    unzip:  cannot find zipfile directory in one of /var/www/html/tp5/vendor/topthink/think-captcha/546f7592b7e0bd74c45a7b9a2780873d or

            /var/www/html/tp5/vendor/topthink/think-captcha/546f7592b7e0bd74c45a7b9a2780873d.zip, and cannot find /var/www/html/tp5/vendor/topthink/think-captcha/546f7592b7e0bd74c45a7b9a2780873d.ZIP, period.

        The archive may contain identical file names with different capitalization (which fails on case insensitive filesystems)

        Unzip with unzip command failed, falling back to ZipArchive class

        Invalid zip file, retrying...

    终究没找出这个错误的原因,无奈,我选取了重装tp5.1

    用composer安装之后,我是先在根目录,即/var/www/html下执行的composer require topthink/think-captcha,发现安装成功,于是接着在tp5目录中再次执行,报了一个警告,但终究还是执行成功了,于是,在控制中写入

    public function captcha(){

        return $this->fetch();

    }

    并创建个captcha页面

    <!DOCTYPE html>

    <html>

        <head>

            <title></title>

        </head>

        <body>

            <div>{:captcha_img()}</div>

        </body>

    </html>

    发现执行不了,这才想起来要执行一下chmod -R 777 runtime,来改变一下目录的权限,再次访问这个页面,然后验证码就成功出来了

    相关文章

      网友评论

          本文标题:composer require topthink/think-

          本文链接:https://www.haomeiwen.com/subject/dcbgjqtx.html