|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2019-07-20 04:24 UTC] pgnet dot dev at gmail dot com
Description:
------------
with
```
php -v
PHP 7.4.0-dev (cli) (built: Jun 22 2019 21:50:55) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0-dev, Copyright (c) Zend Technologies
with Zend OPcache v7.4.0-dev, Copyright (c), by Zend Technologies
```
and freetype2 libs installed
```
rpm -qa | egrep -i "freetype2|libfreetype"
libfreetype6-2.10.1-lp151.170.1.x86_64
freetype2-devel-2.10.1-lp151.170.1.x86_64
pkg-config --libs --cflags freetype2
-I/usr/include/freetype2 -lfreetype
```
building ext gd with freetype support
```
cd /usr/local/src/php7-src/ext/gd
./configure \
--enable-shared --disable-static \
--enable-gd \
--with-external-gd \
--with-webp \
--with-jpeg \
--with-xpm \
--with-freetype \
--with-gnu-ld
...
checking for FreeType 2... yes
...
make
make install
```
checking, module 'gd' is installed,
```
php -m | grep gd
gd
```
& linked,
```
ldd gd.so | grep freetype
libfreetype.so.6 => /usr/lib64/libfreetype.so.6 (0x00007fbcf300b000)
```
but freetype support is not enabled,
```
php -i
...
gd
GD Support => enabled
GD headers Version => 2.2.5
GD library Version => 2.2.5
GIF Read Support => enabled
GIF Create Support => enabled
JPEG Support => enabled
libJPEG Version => 8
PNG Support => enabled
libPNG Version => 1.6.34
WBMP Support => enabled
XPM Support => enabled
libXpm Version => 30411
XBM Support => enabled
WebP Support => enabled
BMP Support => enabled
TGA Read Support => enabled
Directive => Local Value => Master Value
gd.jpeg_ignore_warning => 1 => 1
...
```
and checking for freetype functions FAILs
```
php -r 'return function_exists('imagettfbbox') && function_exists('imagettftext');'
PHP Warning: Use of undefined constant imagettfbbox - assumed 'imagettfbbox' (this will throw an Error in a future version of PHP) in Command line code on line 1
Warning: Use of undefined constant imagettfbbox - assumed 'imagettfbbox' (this will throw an Error in a future version of PHP) in Command line code on line 1
```
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Oct 25 21:00:01 2025 UTC |
You're using single quotes around both the code, and also around the strings. I'm not sure exactly what's happening, but PHP is telling you that it is encountering a "undefined constant imagettfbbox". Also, returning a boolean doesn't show any output. For debugging, try doing var_dump instead, and use double-quotes for the strings: php -r 'var_dump( function_exists("imagettfbbox") && function_exists("imagettftext"));'The point is there's no "freeetype support", php -r 'var_dump(gd_info());' array(13) { ["GD Version"]=> string(5) "2.2.5" ["FreeType Support"]=> >>> bool(false) ["GIF Read Support"]=> bool(true) ["GIF Create Support"]=> bool(true) ["JPEG Support"]=> bool(true) ["PNG Support"]=> bool(true) ["WBMP Support"]=> bool(true) ["XPM Support"]=> bool(true) ["XBM Support"]=> bool(true) ["WebP Support"]=> bool(true) ["BMP Support"]=> bool(true) ["TGA Read Support"]=> bool(true) ["JIS-mapped Japanese Font Support"]=> bool(false) }the point is there's no freetype support, php -r 'var_dump(gd_info());' array(13) { ["GD Version"]=> string(5) "2.2.5" ["FreeType Support"]=> !!! bool(false) ["GIF Read Support"]=> bool(true) ["GIF Create Support"]=> bool(true) ["JPEG Support"]=> bool(true) ["PNG Support"]=> bool(true) ["WBMP Support"]=> bool(true) ["XPM Support"]=> bool(true) ["XBM Support"]=> bool(true) ["WebP Support"]=> bool(true) ["BMP Support"]=> bool(true) ["TGA Read Support"]=> bool(true) ["JIS-mapped Japanese Font Support"]=> bool(false) }