ErrorException: imagettfbbox(): Could not find/open font in
phar:///www/wwwroot/game.com/build/webman.phar/vendor/gregwar/captcha/src/Gregwar/Captcha/CaptchaBuilder.php:345
Stack trace:
沒辦法顯示驗證碼,直接報錯,用的是官方推薦的驗證碼
字體路徑的問題,imagettfbbox
只支持傳入字體文件路徑的字符串或者URL
,不支持流,沒辦法讀取phar
文件內(nèi)部的字體文件,除非你自己傳入外部字體文件的地址,不然確實沒法整。
還有一個浮點轉(zhuǎn)整形的問題 \imagettftext($image, $size, $angle, intval($x), intval($y) + $offset, $col, $font, $symbol);
webman\vendor\gregwar\Captcha\src\Gregwar\Captcha\CaptchaBuilder.php line:365 我真心不知道你們咋會沒問題,反正驗證碼我刷一會就會出現(xiàn)隱式轉(zhuǎn)換的問題。
ErrorException: imagettfbbox(): Could not find/open
這個需要注意中文路徑的問題
還有一個浮點轉(zhuǎn)整形的問題
修改webman\vendor\gregwar\Captcha\src\Gregwar\Captcha\CaptchaBuilder.php line:365
\imagettftext($image, $size, $angle, intval($x), intval($y) + $offset, $col, $font, $symbol);
用 webman/captcha,已經(jīng)解決了phar打包后imagettfbbox(): Could not find/open font
問題。