TIP게시판

제목 captcha font size 폰트 사이즈가 바뀌지 않을 때 참고하세요.
글쓴이 하늘치 작성시각 2022/12/31 20:59:29
댓글 : 0 추천 : 0 스크랩 : 0 조회수 : 3277   RSS

제 경험이 혹 도움이 될까 하여 남깁니다.

 

 

기존에 php7.2 에서 잘 사용하던 captcha 가 php7.4 인 서버로 이전하니 회원가입 페이지의 captcha 부분에서 오류가 나왔습니다.

 

A PHP Error was encountered

Severity: Warning

Message: imagettftext(): Could not find/open font

Filename: helpers/captcha_helper.php

Line Number: 320

Backtrace:

File: /home/math/application/controllers/Auth.phpLine: 549Function: create_captcha

File: /home/math/application/controllers/Auth.phpLine: 213Function: _create_captcha

File: /home/math/public_html/index.phpLine: 328Function: require_once

 

A PHP Error was encountered

Severity: Notice

Message: Trying to access array offset on value of type bool

Filename: controllers/Auth.php

Line Number: 554

Backtrace:

File: /home/math/application/controllers/Auth.phpLine: 554Function: _error_handler

File: /home/math/application/controllers/Auth.phpLine: 213Function: _create_captcha

File: /home/math/public_html/index.phpLine: 328Function: require_once

 

어떻게든 했는데, 이번에는 폰트 사이즈가 조절이 안됩니다;

결론은,, fonts_path 경로 설정이었습니다..

 

$config['captcha_path'] = 'assets/captcha/';

$config['captcha_fonts_path'] = FCPATH.'assets/captcha/fonts/3.ttf';

 

 

검색 사이트 바로 가기

 

$config['captcha_path'] = 'assets/captcha/';
$config['captcha_fonts_path'] = FCPATH.'assets/captcha/fonts/3.ttf';

 

FCPATH 로 폰트 경로를 지정하니 정상적으로 나왔네요.

 

참고로 저는 tank_auth 를 사용하고 있고요, 

리눅스 CentOS 7 + php7.4 + CI 3.1.13 버전 사용중입니다.

 

도움이 되셨으면 좋겠습니다. 

 

관련링크 https://stackoverflow.com/questions/30122368/codeigniter-captcha-helper-is-not-increasing-text-font-size
 다음글 simple tab
 이전글 모바일 환경에서의 이미지 업로드 (2)

댓글

없음