[GH-ISSUE #272] Lost Password Captcha not shown #220

Closed
opened 2026-02-26 09:36:52 +03:00 by kerem · 2 comments
Owner

Originally created by @simarilius on GitHub (Sep 13, 2020).
Original GitHub issue: https://github.com/opensolutions/ViMbAdmin/issues/272

The Reset Password Page doesn't shows a Captcha.

Warning: imageftbbox(): Could not find/open font in /lynn/vimbadmin/pub/vendor/shardj/zf1-future/library/Zend/Captcha/Image.php on line 507

Warning: imagefttext(): Could not find/open font in /lynn/vimbadmin/pub/vendor/shardj/zf1-future/library/Zend/Captcha/Image.php on line 510

I fixed it by adding a directory and the font to /lynn/vimbadmin/pub/data/font/freeserif.ttf

I also had to change the path in library/OSS/Captcha/Image.php:

if( strpos( dirname( FILE ), 'src/' ) === false )
$font = dirname( FILE ) . '/../../../data/font/freeserif.ttf';
else
$font = dirname( FILE ) . '/../../../data/font/freeserif.ttf';

Originally created by @simarilius on GitHub (Sep 13, 2020). Original GitHub issue: https://github.com/opensolutions/ViMbAdmin/issues/272 The Reset Password Page doesn't shows a Captcha. Warning: imageftbbox(): Could not find/open font in /lynn/vimbadmin/pub/vendor/shardj/zf1-future/library/Zend/Captcha/Image.php on line 507 Warning: imagefttext(): Could not find/open font in /lynn/vimbadmin/pub/vendor/shardj/zf1-future/library/Zend/Captcha/Image.php on line 510 I fixed it by adding a directory and the font to /lynn/vimbadmin/pub/data/font/freeserif.ttf I also had to change the path in library/OSS/Captcha/Image.php: if( strpos( dirname( __FILE__ ), 'src/' ) === false ) **$font = dirname( __FILE__ ) . '/../../../data/font/freeserif.ttf';** else $font = dirname( __FILE__ ) . '/../../../data/font/freeserif.ttf';
kerem closed this issue 2026-02-26 09:36:52 +03:00
Author
Owner

@bradley-jarvis commented on GitHub (Jan 17, 2021):

I had the same problem with pretty much the same fix, I put the font file where it was looking for it though so didn't need to change any code

<!-- gh-comment-id:761781478 --> @bradley-jarvis commented on GitHub (Jan 17, 2021): I had the same problem with pretty much the same fix, I put the font file where it was looking for it though so didn't need to change any code
Author
Owner

@alainwolf commented on GitHub (Feb 8, 2021):

My workaround on fresh Ubuntu 20.04 server:

$ sudo apt install fonts-freefont-ttf
$ sudo -u www-data mkdir -p library/data/font
$ sudo -u www-data  ln -s /usr/share/fonts/truetype/freefont/FreeSerif.ttf library/data/font/freeserif.ttf

If you use PHP open_basedir restrictions, make sure /usr/share/fonts/ is included.

<!-- gh-comment-id:774968595 --> @alainwolf commented on GitHub (Feb 8, 2021): My workaround on fresh Ubuntu 20.04 server: $ sudo apt install fonts-freefont-ttf $ sudo -u www-data mkdir -p library/data/font $ sudo -u www-data ln -s /usr/share/fonts/truetype/freefont/FreeSerif.ttf library/data/font/freeserif.ttf If you use PHP [open_basedir](https://www.php.net/manual/en/ini.core.php#ini.open-basedir) restrictions, make sure `/usr/share/fonts/` is included.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/ViMbAdmin-opensolutions#220
No description provided.