PHP and GD
Moderator: General Moderators
-
maxmegalon
- Forum Newbie
- Posts: 9
- Joined: Fri Jun 11, 2004 8:01 am
PHP and GD
Hi, I'm trying to install GD so that I can use some of the graph classes I found on
http://www.phpclasses.org/search.html?w ... o_search=1
It seemed after some experimentation that I was in need of installing GD before things would work.
What I found was that php's configure needed some variables set to succesfully build GD (Note: I'm using php in conjunction with mysql and apache, so therefore there are some variables set for these as well)
./configure --with-apache=../apache_1.3.31 --with-mysql=/usr/local/mysql --with-gd --with-zlib-dir=/usr/local/lib --with-jpg-dir=/usr/local/lib --with-png-dir=/usr/local/lib --enable-gd-native-ttf
I then installed php using:
make
make install
Apache was installed using
./configure --with-layout=Apache --activate-module=src/modules/php4/libphp4.a
make
make install
After restarting apache I still get error messages that seem to point to GD not being installed correctly:
Call to undefined function: imagettfbbox() in /usr/local/apache/htdocs/stats/z/graph.php on line 1269
Can anyone tell me what is wrong? Do I also have to configure apache for the use of GD?
Is there a way of getting more info about the error message or a more detailed error message?
http://www.phpclasses.org/search.html?w ... o_search=1
It seemed after some experimentation that I was in need of installing GD before things would work.
What I found was that php's configure needed some variables set to succesfully build GD (Note: I'm using php in conjunction with mysql and apache, so therefore there are some variables set for these as well)
./configure --with-apache=../apache_1.3.31 --with-mysql=/usr/local/mysql --with-gd --with-zlib-dir=/usr/local/lib --with-jpg-dir=/usr/local/lib --with-png-dir=/usr/local/lib --enable-gd-native-ttf
I then installed php using:
make
make install
Apache was installed using
./configure --with-layout=Apache --activate-module=src/modules/php4/libphp4.a
make
make install
After restarting apache I still get error messages that seem to point to GD not being installed correctly:
Call to undefined function: imagettfbbox() in /usr/local/apache/htdocs/stats/z/graph.php on line 1269
Can anyone tell me what is wrong? Do I also have to configure apache for the use of GD?
Is there a way of getting more info about the error message or a more detailed error message?
-
maxmegalon
- Forum Newbie
- Posts: 9
- Joined: Fri Jun 11, 2004 8:01 am
Well there doesn't appear to be anything obvious, there are only a few small differences for my surrent setup....
The only difference I can see is the version compatability (i.e. 22 vs 23 on the incremental) and I compiled with freetype. Which version of PHP are you using? I'm currently running 4.3.6 and the 'imagettfbbox()' function is definately recognised.
It's probably not much use but here is my base configure.....
Code: Select all
GD Support: enabled
GD Version: bundled (2.0.22 compatible)
FreeType Support: enabled
FreeType Linkage: with freetype
GIF Read Support: enabled
JPG Support: enabled
PNG Support: enabled
WBMP Support: enabled
XBM Support: enabledIt's probably not much use but here is my base configure.....
Code: Select all
#! /bin/sh
#
'./configure' \
'--prefix=/usr/local/php' \
'--with-apxs2=/usr/local/apache2/bin/apxs' \
'--with-curl=/usr/src/curl-7.11.2' \
'--with-gd' \
'--with-jpeg-dir=/usr/lib' \
'--with-png-dir=/usr/lib' \
'--with-freetype-dir=usr/lib' \
'--with-zlib-dir=/usr/lib' \
'--with-bz2=/usr/lib' \
'--enable-bcmath' \
'--enable-calendar' \
'--enable-ftp' \
"$@"-
maxmegalon
- Forum Newbie
- Posts: 9
- Joined: Fri Jun 11, 2004 8:01 am
-
maxmegalon
- Forum Newbie
- Posts: 9
- Joined: Fri Jun 11, 2004 8:01 am
You would require a debug build of descriptions to get anymore info regarding the problem.
The 'call to undefined function' error is basically just that, you are trying to use an undefined function. Have you tired running some of the other GD functions? or is this specific to 'imagettfbbox'?
I have not yet built 4.3.7 so don't know if this is a bug, it wouldn't be the first time they have unintentionally left something out.
You could try building 4.3.6
The 'call to undefined function' error is basically just that, you are trying to use an undefined function. Have you tired running some of the other GD functions? or is this specific to 'imagettfbbox'?
I have not yet built 4.3.7 so don't know if this is a bug, it wouldn't be the first time they have unintentionally left something out.
You could try building 4.3.6
-
maxmegalon
- Forum Newbie
- Posts: 9
- Joined: Fri Jun 11, 2004 8:01 am
Quite possibly, although PHP should build with the bundled GD if you do not specify a directory. That being said though, it wouldn't hurt to remove the GD version installed via rpm.maxmegalon wrote: Just one thought. I tried to install GD via rpm before I got the sources and did the configure make make install part. Could it be that there lies a problem in that?
-
maxmegalon
- Forum Newbie
- Posts: 9
- Joined: Fri Jun 11, 2004 8:01 am
I'm at a bit of a lose as to what to try next. The only thing I can think of now is to try installing a pre-built binary with GD enabled and see how that goes.
Have you had a look through the output of make? It should obviously fall over if it hits a major problem but there maybe something in the output of make which may give you a clue.
Have you tried any other GD specific functions?
Have you had a look through the output of make? It should obviously fall over if it hits a major problem but there maybe something in the output of make which may give you a clue.
Have you tried any other GD specific functions?
-
maxmegalon
- Forum Newbie
- Posts: 9
- Joined: Fri Jun 11, 2004 8:01 am
I added support for freetype since that was one major difference between your config and mine.
GD Support enabled
GD Version bundled (2.0.23 compatible)
FreeType Support enabled
FreeType Linkage with freetype
GIF Read Support enabled
PNG Support enabled
WBMP Support enabled
XBM Support enabled
If I run one of the scripts now, I get font errors like:
Warning: imagettfbbox(): Could not find/open font in /usr/local/apache/htdocs/stats/z/graph.php on line 1269
Also it seems that a PNG object is made be it unsuccesfull:
Warning: Cannot modify header information - headers already sent by (output started at /usr/local/apache/htdocs/stats/z/graph.php:1269) in /usr/local/apache/htdocs/stats/z/graph.php on line 1404
‰PNG
followed by a lot of nonprintable characters.
Does this ring any bells?
GD Support enabled
GD Version bundled (2.0.23 compatible)
FreeType Support enabled
FreeType Linkage with freetype
GIF Read Support enabled
PNG Support enabled
WBMP Support enabled
XBM Support enabled
If I run one of the scripts now, I get font errors like:
Warning: imagettfbbox(): Could not find/open font in /usr/local/apache/htdocs/stats/z/graph.php on line 1269
Also it seems that a PNG object is made be it unsuccesfull:
Warning: Cannot modify header information - headers already sent by (output started at /usr/local/apache/htdocs/stats/z/graph.php:1269) in /usr/local/apache/htdocs/stats/z/graph.php on line 1404
‰PNG
followed by a lot of nonprintable characters.
Does this ring any bells?
-
maxmegalon
- Forum Newbie
- Posts: 9
- Joined: Fri Jun 11, 2004 8:01 am