PHP4 and JPEG How To PART II (for PHP4, the release)
| From: | Eric Esselink | Date: | Tue, 30 May 2000 00:15:02 +0000 |
| Subject: | PHP4 and JPEG How To PART II (for PHP4, the release) | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-19719@lists.php.net to get a copy of this message | ||
Hello,
I've followed all the steps from the earlier message '[PHP-DEV] PHP4 and JPEG How To (was
Re: GD 1.8.1/PHP RC1)' :
>>>>
OK. Here's how I sucessfully got JPEG working in PHP4 :
1) download gd ( http://www.boutell.com/gd/ )
2) Decompress gd
$tar xvzf gd-1.8.1.tar.gz
3) Edit gd's Makefile to fit your needs
$cd gd-1.8.1/
$vi Makefile
You've to tell gd that you want JPEG support in gd's Makefile :
CFLAGS=-O -DHAVE_JPEG
LIBS=-lm -lgd -lpng -lz -ljpeg
Also check where the files will be installed, for example :
INSTALL_LIB=/usr/local/lib/gd
INSTALL_INCLUDE=/usr/local/include/gd
4) Compile gd
$make
(optionnal) check that JPEG support has been
included in GD.
$nm libgd.a | grep GD_JPEG_VERSION
00000004 r GD_JPEG_VERSION
5) Install gd
$su
#make install
#exit
6) Configure PHP using your favorite options :
$cd ../php4
$./configure --prefix=/usr \
--with-apxs=/usr/local/apache/bin/apxs \
--with-shared-apached=/etc/httpd \
--with-config-file-path=/usr/lib \
--with-regex=apache \
--without-pcre-regex \
--enable-debug=no \
--enable-versioning \
--enable-safe-mode \
--enable-track-vars \
==> --with-gd=/usr/local \
==> --with-jpeg-dir=/usr \
--with-ttf=/usr/lib
Two notes :
1)"--with-gd=/usr/local" is used to find the following files :
/usr/local/lib/gd/gd.a
/usr/local/include/gd/gd*.h
2)"--with-jpeg-dir=/usr" is used to find the jpeg library :
/usr/lib/libjpeg.so
Then, I get in the output of ./configure :
checking whether to include GD support... yes (static)
checking for gdImageString16 in -lgd... yes
checking for compress in -lz... yes
checking for png_info_init in -lpng... yes
checking for gdImageColorResolve in -lgd... yes
checking for gdImageCreateFromPng in -lgd... yes
checking for gdImageCreateFromGif in -lgd... no
checking for libjpeg (needed by gd-1.8+)... yes
checking for jpeg_read_header in -ljpeg... yes
checking for gdImageCreateFromJpeg in -lgd... yes
<<<
If i do all of this using PHP4, -- the released version --, then my end-result looks like this:
...
checking whether to include GD support... yes (static)
checking for gdImageString16 in -lgd... (cached) no
checking for compress in -lz... (cached) no
checking for png_info_init in -lpng... (cached) no
checking for gdImageColorResolve in -lgd... (cached) no
checking for gdImageCreateFromPng in -lgd... (cached) no
checking for gdImageCreateFromGif in -lgd... (cached) no
checking for libjpeg (needed by gd-1.8+)... yes
checking for jpeg_read_header in -ljpeg... (cached) yes
checking for gdImageCreateFromJpeg in -lgd... (cached) no
checking whether to include ttf support... no
...
My configure statement:
./configure \
--prefix=/usr \
--with-apxs \
--with-shared-apached=/etc/httpd \
--with-config-file-path=/etc/httpd/conf/php \
--with-regex=apache \
--without-pcre-regex \
--enable-debug=no \
--enable-versioning \
--enable-safe-mode \
--enable-track-vars \
--with-gd=/usr/local \
--with-jpeg-dir=/usr \
--with-ttf=/usr/lib \
--with-zlib=/usr \
--with-mysql
>> $nm libgd.a | grep GD_JPEG_VERSION
>> 00000004 r GD_JPEG_VERSION
This is what i got also...
>> /usr/local/lib/gd/gd.a
I don't have this one, mine is called libgd.a in the same directory. GD versions are identical.
I've tried about everything i know, nothing helped and i can sure use some help now! I'm
stuck...
Thanks,
Eric Esselink
Mailto: Eric@NetTrade.nl