제 경험이 혹 도움이 될까 하여 남깁니다.
기존에 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 버전 사용중입니다.
도움이 되셨으면 좋겠습니다.