LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (http://www.linuxquestions.org/questions/programming-9/)
-   -   PHP Call to undefined function imagettfbbox() (http://www.linuxquestions.org/questions/programming-9/php-call-to-undefined-function-imagettfbbox-289547/)

QtCoder 02-13-2005 01:16 AM

PHP Call to undefined function imagettfbbox()
 
Ok, here's the situation. I've compiled and installed Apache2 and PHP 5 on my Slackware 10 machine. I compiled with GD support. All of the GD functions seem to work until I get to the TTF related ones.

So, first I checked php.net. It said I needed FreeType 1 and/or 2, jpeg, png, xpm, and zlib. Well, I already compiled those in without any configure/make warnings/errors.

On to google. It seems many people are having the same issue, and none have had it resolved, as far as I could tell.

Here's my config (from config.nice):

Code:

'./configure' \
'--with-mysql=/usr/local/mysql' \
'--with-apxs2=/usr/local/apache2/bin/apxs' \
'--with-curl' \
'--enable-ftp' \
'--with-pspell' \
'--enable-sockets' \
'--with-pdflib' \
'--with-gd' \
'--with-jpeg-dir' \
'--with-png-dir' \
'--with-zlib-dir' \
'--with-ttf' \
'--enable-gd-native-ttf' \
'--with-freetype-dir' \
'--with-xpm-dir=/usr/X11R6' \

Yes, I know I haven't specified dirs on several options like jpeg and png, but as shown by the following output of print_r(gd_info()), PHP used the defaults and they worked just fine.

Code:

Array
(
    [GD Version] => bundled (2.0.28 compatible)
    [FreeType Support] =>
    [T1Lib Support] =>
    [GIF Read Support] => 1
    [GIF Create Support] => 1
    [JPG Support] => 1
    [PNG Support] => 1
    [WBMP Support] => 1
    [XPM Support] =>
    [XBM Support] => 1
    [JIS-mapped Japanese Font Support] =>
)

However, notice XPM and FreeType. They are not enabled. This is obviously why PHP can't find imagettfbbox(). FreeType isn't even enabled! I've made sure all the necessary libs and includes are installed on my machine. I've tried several different paths for the config options like --with-xpm-dir=/usr/X11R6/lib or --with-freetype-dir=/usr/include/freetype2/freetype but to no avail. I have exhausted every possible path to libs and includes I could find for each option -- and of course, configure never complained.

I'm beginning to think it's an issue of versions, but I don't know for sure.

I should go through config.log for more info, but since it's past midnight and I'm exhausted, I thought I'd let someone else do the thinking for a while. :-)

Any help is GREATLY appreciated!!

keefaz 02-13-2005 03:58 AM

Did you try :
./configure ... ... --with-freetype --with-freetype-dir=/usr/lib ...

QtCoder 02-13-2005 01:54 PM

Yep, I already tried that. However, one thought occurred to me. I am beginning to think the gd package I got from linuxpackages.net didn't have freetype support compiled in. I'm compiling it now with freetype and I'll point php to the new install location to see if my idea is right.

QtCoder 02-13-2005 02:31 PM

Scrap that idea. Moving on to others...

keefaz 02-13-2005 05:36 PM

With php > 4.3 it is advised to use its built-in gd support

Also did you try :
--with-freetype-dir=/usr/include/freetype2/freetype

QtCoder 02-14-2005 02:38 PM

Well, my first attempts at compiling PHP with GD involved using the bundled GD version. It worked except for freetype. Then I tried the separate one from linuxpackages.net, and finally a self-compiled one. Each worked with the exception of freetype support.

I have tried '--with-freetype-dir=/usr/include/freetype2/freetype' but it didn't work.

This just doesn't make sense to me. Configure indicates that FreeType was found, as well as XPM. During the compilation, I can see the -lfreetype and -lXpm switches and there are no warnings or errors that they don't exist. Make completes perfectly, and yet neither xpm nor freetype shows up in phpinfo() or gd_info(). :(

Any other suggestions?

keefaz 02-14-2005 05:54 PM

I suppose you already tried ' --with-freetype-dir=/usr ', when you test php do you restart apache each time ?

QtCoder 02-14-2005 06:35 PM

Yes to both. I've even restarted my machine just to reload everything.

I think I'll watch some TV for a while, stuff my face, and let my mind wander for a while. Maybe I'll have one of those "Oh, of course!" moments. :)

QtCoder 02-15-2005 01:06 PM

Yes!! I got it working... but I did something I shouldn't have to do (afaik). I ran 'make clean' before re-compiling. Shouldn't it automatically detect which files need to be recompiled and compile them?

Anyway, I'm glad it's working. I can finally go back to business as usual! :D

Thanks for the input.

Ryand833 04-27-2005 11:05 AM

Quote:

Originally posted by QtCoder
Yes!! I got it working... but I did something I shouldn't have to do (afaik). I ran 'make clean' before re-compiling. Shouldn't it automatically detect which files need to be recompiled and compile them?

Anyway, I'm glad it's working. I can finally go back to business as usual! :D

Thanks for the input.

Woohoo! Thanks for posting this. I was having the same problem, except with JPG support. make clean fixed it right up :D

Barca 07-31-2005 05:56 AM

Oh yeah! Make clean! It works :)
Sorry for posting in old topic but I had to express my joy.

soan 08-17-2005 05:26 AM

Thank God
 
I've been pulling my hair out with this shit - check my version of gd and freetype

recompiled php like 50 time and then we have

make clean which saves the day

thanx alot for this post really help

Santrino 09-20-2006 05:18 AM

Make Clean!!! :eek:

I was having the same problem!!!
Now it works: Many thx!!!

chr00t 09-24-2006 01:29 PM

Make Clean Saves the Day!
 
soan:
"I've been pulling my hair out with this shit - check my version of gd and freetype

recompiled php like 50 time..."

Totally man.. I was about ready to install umbuntu :Pengy: again..
btw, my problem was with the imagettfbbox() :scratch: .. recompiled about
51 times.. :cool: (hahaha) and with make clean, it did the trick. :D :D :D

thanks guys! :Pengy: :Pengy:

p.s. I hope this thing doesn't show i'm on a winblows box... (currently running umbuntu debian on my lapytopy..) anybody got an idea how to install the default software modem from a toshiba satelite model A75-S125? :scratch:

Matir 09-26-2006 08:54 AM

Apparently the makefile needs some cleaning...


All times are GMT -5. The time now is 12:20 AM.