TP5 code verification solutions do not appear in the cloud server

After tp5 using think-captcha, normal display of the local environment, it may be placed on the cloud server but can not be displayed.

 

The method is very simple, with this in vendor / topthink / think-captcha / src / CaptchaController.php in ob_clean () ; so it can clear the cache area

namespace think\captcha;

use think\Config;

class CaptchaController
{
    public function index($id = "")
    {
        $captcha = new Captcha((array)Config::get('captcha'));
       ob_clean();
        return $captcha->entry($id);
    }
}

This can solve the problem with a verification code does not come out.

Guess you like

Origin www.cnblogs.com/whs5280/p/11324103.html