On calling the function imagettfbbox(), I'm getting the error
Fatal error: Uncaught Exception: Function "imagettfbbox" does not exist: check your FreeType installation in...
I understand from many sources, including other stackoverflow questions and PHP manual that I need to compile PHP with freetype support.
My challenge is I do not know exactly how to go about this. Manual says:
To enable support for FreeType 2 add --with-freetype-dir=DIR
Where is this flag to be set?
More importantly, how do I go from my existing set up (detailed following) to this stage?
Set-up (running in a container built off the php7.3.33-apache official image)
Apache2 and PHP7.3
gd is installed, showing in phpinfo as follows: GD Support enabled/ GD Version bundled (2.1.0 compatible)/ GIF Read Support enabled/ GIF Create Support enabled/ PNG Support enabled/ libPNG Version 1.6.37/ WBMP Support enabled/
XBM Support enabled/usr/include/freetype2 folder exists and under it, freetype folder and ft2build.h
a var_dump of gd_info() yields the following:
["GD Version"]=> string(26) "bundled (2.1.0 compatible)" ["FreeType Support"]=> bool(false) ["GIF Read Support"]=> bool(true) ["GIF Create Support"]=> bool(true) ["JPEG Support"]=> bool(false) ["PNG Support"]=> bool(true) ["WBMP Support"]=> bool(true) ["XPM Support"]=> bool(false) ["XBM Support"]=> bool(true) ["WebP Support"]=> bool(false) ["BMP Support"]=> bool(true) ["JIS-mapped Japanese Font Support"]=> bool(false)
In essence, my PHP is pre-compiled. How do I replace this with my own re-compilation as the manual seems to be saying.