갤러리게시판에서 아래와같은 에러가 있습니다. 정보
갤러리게시판에서 아래와같은 에러가 있습니다.본문
갤러리게시판을 바꾸니까 이미지 용량때문인지 아래와같은 에러 메세지가 나오는데
어떻게 해결할 지 고수님들 도와주세요.
------------------------------------
$thumb = $thumb_path.'/'.$list[$i][wr_id];
if (!file_exists($thumb)) {
$file = $list[$i][file][0][path] .'/'. $list[$i][file][0][file];
// 업로드된 파일이 이미지라면
if (preg_match("/\.(jp[e]?g|gif|png)$/i", $file) && file_exists($file)) {
$size = getimagesize($file);
if ($size[2] == 1)
$src = imagecreatefromgif($file);
else if ($size[2] == 2)
$src = imagecreatefromjpeg($file);
else if ($size[2] == 3)
$src = imagecreatefrompng($file);
else
break;
$rate = $img_width / $size[0];
$height = (int)($size[1] * $rate);
// 계산된 썸네일 이미지의 높이가 설정된 이미지의 높이보다 작다면
if ($height < $img_height)
// 계산된 이미지 높이로 복사본 이미지 생성
$dst = imagecreatetruecolor($img_width, $height);
else
// 설정된 이미지 높이로 복사본 이미지 생성
$dst = imagecreatetruecolor($img_width, $img_height);
imagecopyresampled($dst, $src, 0, 0, 0, 0, $img_width, $height, $size[0], $size[1]);
imagejpeg($dst, $thumb_path.'/'.$list[$i][wr_id], $img_quality);
chmod($thumb_path.'/'.$list[$i][wr_id], 0606);
}
}
어떻게 해결할 지 고수님들 도와주세요.
------------------------------------
$thumb = $thumb_path.'/'.$list[$i][wr_id];
if (!file_exists($thumb)) {
$file = $list[$i][file][0][path] .'/'. $list[$i][file][0][file];
// 업로드된 파일이 이미지라면
if (preg_match("/\.(jp[e]?g|gif|png)$/i", $file) && file_exists($file)) {
$size = getimagesize($file);
if ($size[2] == 1)
$src = imagecreatefromgif($file);
else if ($size[2] == 2)
$src = imagecreatefromjpeg($file);
else if ($size[2] == 3)
$src = imagecreatefrompng($file);
else
break;
$rate = $img_width / $size[0];
$height = (int)($size[1] * $rate);
// 계산된 썸네일 이미지의 높이가 설정된 이미지의 높이보다 작다면
if ($height < $img_height)
// 계산된 이미지 높이로 복사본 이미지 생성
$dst = imagecreatetruecolor($img_width, $height);
else
// 설정된 이미지 높이로 복사본 이미지 생성
$dst = imagecreatetruecolor($img_width, $img_height);
imagecopyresampled($dst, $src, 0, 0, 0, 0, $img_width, $height, $size[0], $size[1]);
imagejpeg($dst, $thumb_path.'/'.$list[$i][wr_id], $img_quality);
chmod($thumb_path.'/'.$list[$i][wr_id], 0606);
}
}
댓글 전체

php 메모리설정은 40메가정도면 높은건데 메모리부족이네요
php.ini 의 memory-limit 를 더늘려두 보시고
갤러리를 바꿧다면 기존등록된 이미지의 썸네일이 새로 생성될거같군여
생성요청이 한꺼번에 몰려서 부하가 높을겁니다
페이지내 출력돼는 리스팅 수를 최대한 줄여보세요
php.ini 의 memory-limit 를 더늘려두 보시고
갤러리를 바꿧다면 기존등록된 이미지의 썸네일이 새로 생성될거같군여
생성요청이 한꺼번에 몰려서 부하가 높을겁니다
페이지내 출력돼는 리스팅 수를 최대한 줄여보세요
제가 php에대해 많이 부족하여
위의 설명을 잘 이해를 못하겠습니다.
좀 구체적으로 설명을 해 주셨으면 부탁드릴게요
위의 설명을 잘 이해를 못하겠습니다.
좀 구체적으로 설명을 해 주셨으면 부탁드릴게요
서버 설정값 에서 허용하는 것 이상으로 큰 이미지를 올리면 저렇게 됩니다
서버 설정을 수정할 수 없을테니 이미지 자체를 용량이 작은 것으로 올리는 수 밖에 없을 것 같습니다
서버 설정을 수정할 수 없을테니 이미지 자체를 용량이 작은 것으로 올리는 수 밖에 없을 것 같습니다