# Installing PHP5 with TTF support

## Kaklz

Well, the question might be rather simple for the gurus out there ..

I'm installing PHP5 on my Gentoo box, but there are some PHP scripts that require the image ttf manipulation functions, like imagettftext, imagettfbox, etc. 

I've installed PHP with gd, gd-external, tiff, png, jpg and truetype USE flags, however PHP still reports that imagettftext is a call to undefined function.

As far as I read in PHP manual and surfed through this forum, I found out there is one more USE flag that I should add:

USE="xpm" emerge php mod_php

The problem is - when I add xpm to the USE flags, my gentoo box asks me to install X server. As that's a web server, I'm trying to set up, there's no need for X server. 

So the question is - is there any performance difference if I have X server installed, or not? Why do I need X server for my web server? Actually I don't believe that every web server with ttf support has X installed  :Rolling Eyes: 

Maybe there is some other way of installing PHP with full ttf support, without installing X server? 

What about using --nodeps when doing emerge? will PHP work correctly?

Thanks in advance!

----------

## Deathwing00

Moved from Installing Gentoo.

----------

## bone

To get imagettftext and some of the other functions in mod_php5, you need to make sure that freetype is installed on your system. The problem that I am encountering is that it is installed on mine, yet the mod_php ebuild is not recognizing it.

Hoping to find some more info on this soon.

jt

----------

## AlbertLash

I am in the same bind. The is really no need for a fully blown out X server. I'll keep diggin' on the net to see what I can find.

----------

## AlbertLash

http://us3.php.net/imagettftext

Read BuddyHacker's comment: 

"BuddyHacker

21-Jul-2005 03:55

A correction to Paul Reinheimer's note above regarding this PHP error:

Fatal error: Call to undefined function imagettftext().

Paul states that you need XPM libraries to resolve this issue.  This is not true.  There is an error message that originates from "configure" which mistakenly shows itself when other components are missing.  For instance, if you tell "configure" to add JPEG support, and it can't find the libraries, it will tell you it can't find the JPEG libraries AND it will recommend adding --with-xpm to solve the problem.  This recommendation is ill-placed and misleading.

I received the same error message above, along with the recommendation to add XPM supprt.  However I resolved it by adding the --with-freetype-dir  AND --enable-gd-native-ttf  options  to the "configure" command line.  I did _not_ need XPM.

There are other variations to this error message, such as the script recommending adding JPEG support or PNG support to resolve it's own inability to locate other libraries.  The script needs some cleanup in order to fix these poorly placed recommendations.

FYI, imagettftext() is a call to one of the truetype fonts functions.  It is NOT related in any way to the XPM libraries, so it is not required unless you explicitly want XPM functionality."

----------

## samek

Good evening,

i'm having the same problem as bone. Anyone have any idea what to do?

EDIT: I did two things and i'm not really sure which of them helped. 

1. Added truetype flage to USE in make.conf

2. Recompiled libX11 libXt libXext xproto libXpm.

I think that first action helped me.

----------

