Hi! I've compiled PHP 4.0 with library jpeg6b, but when using ImageJpeg() I get message "No JPEG support in this PHP ... ". Any ideas? Thanks a lot! Maks
Did you compile PHP with the GD library?
yes, "--with-gd"
And you made sure that GD uses the Jpeg6b ?
i've just compiled it with standard method without specyfing exclusive options I'm not familiar enough about things like modyfing MAKEFILE to handle this by myself.
I've just found the solution, thanks for help!!!
It is customary to share solutions on the forum, even if you found it yourself. Others may find your solution a real time saver.
You're right, please excuse me. Here it is compete guide how get JPEG working with PHP, by Flavien Lebarbe:
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 > > You can also check php_config.h for the following : > #define HAVE_GD_JPG 1 > > 7) Build PHP > $make > You can check for JPEG support with : > $nm ext/gd/gd.o | grep Jpeg > U gdImageCreateFromJpeg > U gdImageJpeg > > 8) Install PHP > $su > #make install > #exit > > 9) That's it ! (don't forget to restart apache, if that's > your situation). > > 10) Test : > <?php > Header("Content-type: image/jpeg"); > $me=ImageCreateFromJPEG("me.jpg"); > ImageJPEG($me); > ?> > > Enjoy ! :-) > > Please check the "optionnal" tests if anything goes wrong. > > Hope this helps, > Flavien Lebarbé. > -- > Flavien LEBARBE OPEN CARE Support for Freedom > mailto:flebarbe@ocare.com http://www.ocare.com > Tel:+33 141430890 Fax:+33 141430891
Thank you, that was an excellent post. I will save it for reference.
Ugh...I'be been trying to get php to work with jpeg support all day. I have followed the suggested instructions and still no luck.Still get the error "No Jpeg support in this php build". Any suggestions?