hsh369625900
- hsh369625900 回复了 性感的农民 的回复
试试在CCaptchaAction.php的renderImageGD($code)的末尾部分,输出图像之前,加
ob_clean()
清空输出缓冲区:protected function renderImageGD($code) { 。。。。。。 //省略xxx行 imagecolordeallocate($image,$foreColor); ob_clean(); // <================================ 情况输出缓冲区 header('Pragma: public'); header('Expires: 0'); header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); header('Content-Transfer-Encoding: binary'); header("Content-Type: image/png"); imagepng($image); imagedestroy($image); }
我也莫名奇妙的突然遇到了这个问题,报图片显示错误,加上这个ob_clean(),问题解决了
- hsh369625900 回复了 zifeiyu 的评论
本地上传图片都是好的,在服务器(ubuntu)上就只显示图片文件名,但也没有报错,我看了服务器上的文件,它没有创建文件夹,但是我的权限都是给了的
上传路径是这样的
"images/{yyyy}{mm}{dd}/{time}{rand:6}"
不错,好使,改$rootPath可以更改根目录位置