LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 02-13-2005, 01:16 AM   #1
QtCoder
Member
 
Registered: Aug 2003
Location: USA
Distribution: Slackware 12.0 RC1
Posts: 129

Rep: Reputation: 15
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!!
 
Old 02-13-2005, 03:58 AM   #2
keefaz
LQ Guru
 
Registered: Mar 2004
Distribution: Slackware
Posts: 6,552

Rep: Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872
Did you try :
./configure ... ... --with-freetype --with-freetype-dir=/usr/lib ...
 
Old 02-13-2005, 01:54 PM   #3
QtCoder
Member
 
Registered: Aug 2003
Location: USA
Distribution: Slackware 12.0 RC1
Posts: 129

Original Poster
Rep: Reputation: 15
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.

Last edited by QtCoder; 02-14-2005 at 02:41 PM.
 
Old 02-13-2005, 02:31 PM   #4
QtCoder
Member
 
Registered: Aug 2003
Location: USA
Distribution: Slackware 12.0 RC1
Posts: 129

Original Poster
Rep: Reputation: 15
Scrap that idea. Moving on to others...
 
Old 02-13-2005, 05:36 PM   #5
keefaz
LQ Guru
 
Registered: Mar 2004
Distribution: Slackware
Posts: 6,552

Rep: Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872
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
 
Old 02-14-2005, 02:38 PM   #6
QtCoder
Member
 
Registered: Aug 2003
Location: USA
Distribution: Slackware 12.0 RC1
Posts: 129

Original Poster
Rep: Reputation: 15
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?
 
Old 02-14-2005, 05:54 PM   #7
keefaz
LQ Guru
 
Registered: Mar 2004
Distribution: Slackware
Posts: 6,552

Rep: Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872
I suppose you already tried ' --with-freetype-dir=/usr ', when you test php do you restart apache each time ?
 
Old 02-14-2005, 06:35 PM   #8
QtCoder
Member
 
Registered: Aug 2003
Location: USA
Distribution: Slackware 12.0 RC1
Posts: 129

Original Poster
Rep: Reputation: 15
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.
 
Old 02-15-2005, 01:06 PM   #9
QtCoder
Member
 
Registered: Aug 2003
Location: USA
Distribution: Slackware 12.0 RC1
Posts: 129

Original Poster
Rep: Reputation: 15
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!

Thanks for the input.
 
Old 04-27-2005, 11:05 AM   #10
Ryand833
Member
 
Registered: Jan 2004
Distribution: Fedora Core 4
Posts: 31

Rep: Reputation: 15
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!

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
 
Old 07-31-2005, 05:56 AM   #11
Barca
LQ Newbie
 
Registered: Nov 2004
Location: Poland
Distribution: Slackware - best and only ;]
Posts: 29

Rep: Reputation: 15
Oh yeah! Make clean! It works
Sorry for posting in old topic but I had to express my joy.
 
Old 08-17-2005, 05:26 AM   #12
soan
LQ Newbie
 
Registered: Aug 2005
Posts: 1

Rep: Reputation: 0
Talking 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
 
Old 09-20-2006, 05:18 AM   #13
Santrino
LQ Newbie
 
Registered: Sep 2006
Distribution: Fedora or Suse
Posts: 1

Rep: Reputation: 0
Thumbs up

Make Clean!!!

I was having the same problem!!!
Now it works: Many thx!!!
 
Old 09-24-2006, 01:29 PM   #14
chr00t
LQ Newbie
 
Registered: Sep 2006
Location: Costa Rica
Distribution: GNU/Linux - Umbuntu Debian (Dapper)
Posts: 4

Rep: Reputation: 0
Talking 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 again..
btw, my problem was with the imagettfbbox() .. recompiled about
51 times.. (hahaha) and with make clean, it did the trick.

thanks guys!

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?
 
Old 09-26-2006, 08:54 AM   #15
Matir
LQ Guru
 
Registered: Nov 2004
Location: San Jose, CA
Distribution: Debian, Arch
Posts: 8,507

Rep: Reputation: 128Reputation: 128
Apparently the makefile needs some cleaning...
 
  


Reply

Tags
freetype, function, php, truetype, ttf, undefined


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
PHP: call to undefined function preg_match() (I think to do with PCRE) BuckRogers01 Linux - Software 1 10-17-2005 01:35 PM
Call to undefined function domxml_open_mem() apt Programming 2 04-01-2005 03:25 AM
Fatal Error - Call to undefined function : pg_pconnect() in filename.php on line xx mwpeng Linux - Newbie 1 02-26-2005 08:57 AM
Call to undefined function: mail() in PHP pembo13 Fedora 0 07-28-2004 07:40 PM
PHP: Call to undefined function: session_start() wellmt Linux - Newbie 2 06-01-2004 05:50 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 08:06 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration