Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 70172 - php5 mod_php5 ttf support configure flags missing
Summary: php5 mod_php5 ttf support configure flags missing
Status: RESOLVED INVALID
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Development (show other bugs)
Hardware: x86 Linux
: High blocker (vote)
Assignee: PHP Bugs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-11-05 08:38 UTC by Ingus Rukis
Modified: 2005-01-10 05:23 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ingus Rukis 2004-11-05 08:38:49 UTC
When I try to emerge php5 and mod_php5, I cannot get ttf functions to work - as far as I see in the emerge process, there are some configure flags missing, although I've added them to use flags.

Reproducible: Always
Steps to Reproduce:
1.ACCEPT_KEYWORDS="~x86" USE="-* gd gd-external jpeg png tiff truetype xpm zlib" emerge -v php mod_php
2.
3.

Actual Results:  
Calculating dependencies ...done!
>>> emerge (1 of 2) dev-php/php-5.0.2-r1 to /
>>> md5 src_uri ;-) php-5.0.2.tar.bz2
>>> Unpacking source...
>>> Unpacking php-5.0.2.tar.bz2 to /var/tmp/portage/php-5.0.2-r1/work
 * Applying php5_soap_persistence_session.diff ...                             
                                      [ ok ]
 * Applying uClibc/libtool patches ...
 *  Fixing ${S}/configure...                                                   
                                      [ ok ]
>>> Source unpacked.
--disable-cgi --enable-cli --enable-embed
--with-config-file-path=/etc/php/cli-php5 --disable-bcmath --without-bz2
--disable-calendar --without-cpdflib --disable-ctype --without-curl
--without-curlwrappers --disable-dbase --disable-dio --disable-dom
--disable-exif --without-fam --without-fbsql --without-fdftk --disable-filepro
--disable-ftp --without-gettext --without-gmp --without-hwapi --without-iconv
--without-informix --without-ingres --without-interbase --disable-libxml
--disable-mbstring --without-mcrypt --without-mcve --disable-memory-limit
--without-mhash --without-mime-magic --without-ming --without-mnogosearch
--without-msql --without-mssql --without-ncurses --without-oci8 --without-oracle
--without-openssl --without-openssl-dir --without-ovrimos --disable-pcntl
--without-pcre-regx --without-pfpro --without-pgsql --disable-posix
--without-pspell --without-recode --disable-simplexml --disable-shmop
--without-snmp --disable-soap --disable-sockets --disable-spl --without-sybase
--without-sybase-ct --disable-sysvmsg --disable-sysvsem --disable-sysvshm
--without-tidy --disable-tokenizer --disable-wddx --without-xsl --without-xmlrpc
--disable-yp --with-zlib --disable-debug --with-jpeg-dir=/usr --with-gd=/usr
--disable-gd-jis-conf --enable-gd-native-ttf --without-mysqli --disable-session
--without-sqlite --disable-dba --without-readline --without-libedit

I don't see xpm and freetype configuration flags there and this leads to
incorrect compilation of PHP - imagettftext, and similar functions that use ttf
show up as undefined.

Expected Results:  
I would expect the correct configure flags to appear, so I can compile php and
mod_php with full ttf support and use all of ttf functions

Portage 2.0.50-r11 (default-x86-2004.2, gcc-3.3.3, glibc-2.3.3.20040420-r0,
2.6.8-gentoo-r3)
=================================================================
System uname: 2.6.8-gentoo-r3 i686 Pentium II (Klamath)
Gentoo Base System version 1.4.16
Autoconf: sys-devel/autoconf-2.59-r4
Automake: sys-devel/automake-1.8.3
ACCEPT_KEYWORDS="x86"
AUTOCLEAN="yes"
CFLAGS="-O2 -mcpu=i586 -fomit-frame-pointer"
CHOST="i586-pc-linux-gnu"
COMPILER=""
CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3/share/config
/usr/share/config /var/qmail/alias /var/qmail/control /var/vpopmail/domains
/var/vpopmail/etc"
CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d"
CXXFLAGS="-O2 -mcpu=i586 -fomit-frame-pointer"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoaddcvs ccache sandbox"
GENTOO_MIRRORS="http://gentoo.osuosl.org
http://distro.ibiblio.org/pub/Linux/distributions/gentoo"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY=""
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="apache apm arts avi berkdb bitmap-fonts crypt encode f77 foomaticdb gdbm
gif gpm gtk2 imlib jpeg kde libg++ libwww mad mikmod motif mpeg mysql ncurses
nls oggvorbis opengl oss pam pdflib perl php png postgres python quicktime
readline sdl slang spell ssl svga tcpd truetype x86 xml2 xmms xv zlib"
Comment 1 Ingus Rukis 2004-11-05 08:40:23 UTC
Quote from http://php.net/imagettftext:

If you compiled PHP yourself but get an error:
Fatal error: Call to undefined function imagettftext().

You need to compile PHP with more options.

--with-gd
--enable-gd-native-ttf
--with-png
--with-zlib-dir=/usr/local/lib/zlib-1.2.1
--with-ttf
--with-jpeg-dir=/usr/local/lib/jpeg-6b/
--with-freetype-dir=/usr/local/lib/freetype-2.1.9/
--with-xpm-dir=/usr/X11R6/

The next set deal with setting up GD, and the appropriate options. Just enabling GD, ttf, png & jpeg is NOT enough. You also need Freetype and XPM.
Comment 2 rojaro 2005-01-05 06:55:53 UTC
The following code from the php5-sapi.eclass is probably responsible for this mess. It also breaks t1lib support.

        if useq gd-external ; then
                enable_extension_with   "gd"                    "gd-external" 1 "/usr"
                enable_extension_enable "gd-jis-conf"   "nls"           0
                enable_extension_enable "gd-native-ttf" "truetype"      0
        else
                enable_extension_with   "freetype-dir"  "truetype"      0 "/usr"
                enable_extension_with   "t1lib"                 "truetype"      0 "/usr"
                enable_extension_with   "ttf"                   "truetype"      0 "/usr"
                enable_extension_enable "gd-jis-conf"   "nls"           0
                enable_extension_enable "gd-native-ttf" "truetype"      0
                enable_extension_with   "png-dir"               "png"           0 "/usr"
                enable_extension_with   "tiff-dir"              "tiff"          0 "/usr"
                enable_extension_with   "xpm-dir"               "xpm"           0 "/usr/X11R6"
                # enable gd last, so configure can pick up the previous settings
                enable_extension_with   "gd"                    "gd"            0
        fi 
Comment 3 rojaro 2005-01-10 04:56:21 UTC
One Month and nothing happend and loads of statistical programs use the gd functions for rendering charts. If they also use postscript fonts, they all get broken by this bug. 
Comment 4 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2005-01-10 05:23:14 UTC
If you USE=gd-external, then the following options would have NO effect on PHP. They are passed thru to the internal copy of GD.
 enable_extension_with   "freetype-dir"  "truetype"      0 "/usr"
                enable_extension_with   "t1lib"                 "truetype"      0 "/usr"
                enable_extension_with   "ttf"                   "truetype"      0 "/usr"
                enable_extension_with   "png-dir"               "png"           0 "/usr"
                enable_extension_with   "tiff-dir"              "tiff"          0 "/usr"
                enable_extension_with   "xpm-dir"               "xpm"           0 "/usr/X11R6"

Either turn off USE=gd-external, or go and ensure that your external GD is compiled with all of the options required.