I have IIS, version 10.0.18362.1, installed on my local machine and have updated the PHP version to version 7.4.4. I noticed captcha PHP script is only showing the background image and not the characters. However, when I change the PHP version to 7.0.30, the characters are visible.
I know that to display the characters, gd support is required. I confirmed that gd support is enabled for version 7.4.4. Looking over phpinfo for version 7.0.30 and 7.4.4, the only differences are:
version 7.0.30
- FreeType version 2.8.1
version 7.4.4
- FreeType version 2.9.1
- Has two extra fields; BMP Support and TGA Read Support. Both are enabled.
I greatly appreciated any assistance with displaying captcha characters for PHP version set higher than 7.0.30 using IIS version 10.0.18362.1 as the localhost server.
Thanks in advance
2
Answers
You could try to Enable 32-bit application for your website in IIS manager->application pool->advanced setting->change Enable 32-bit application from false to true.
you may need to check whether the static content feature has been enabled in turn windows features on or off.
https://www.php.net/manual/tr/function.imagettftext.php
putenv(‘GDFONTPATH=’ . realpath(‘.’));
// Font type (.ttf not use)
$file = ‘filename’;
imagettftext($image, 20, 0, 10, 20, $siyah, $file, $text);