此方法在百度虛擬機上也是可以的姑食,親測有效封救,如果此文對你有幫助政溃,麻煩給個贊
我的TP5項目放到西部數(shù)碼下 自帶的驗證碼功能不顯示 在網(wǎng)上找到了一種可使用的方法
清除緩沖區(qū)就應該可以了艇劫,解決的辦法是在vendor/topthink/think-captcha/src/CaptchaController.php中加上這個ob_clean();就可以了
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);
}
}
用此即可解決驗證碼不出來的問題。
原文鏈接:https://blog.csdn.net/wanganji5252/article/details/86471528