Hi
I've installed Drupal a week ago and I have a problem with th GD library. I've installed it from http://il2.php.net/gd like i was instructed, I got PHP 5.2.3 on a linux,
At first there was an error on the main admin page saying I don't have GD installed, even after installing it.
I changed my php configure command to
'./configure' '--with-apxs2=/usr/local/apache2/bin/apxs' '--with-mysql' '--enable-soap' '--with-openssl' '--with-gd' '--with-ttf' '--with-jpeg' '--with-freetype' '--enable-gd-native-ttf'
ran make and make install, and now the error is gone, but on the captcha module page it says:
"Images cannot be generated, because your PHP installation's GD library has no JPEG support."
an it won't let me use the captcha image, only the math and text, which I don't want to use.
can someone help me figure out how to fix this?

thanks a bunch

rocky

Comments

HotDrupal.com’s picture

--with-jpeg should do it ... I remember having this problem once, but can't quite remember the fix. I think I might have made a copy of my options, moved the PHP install directory to a backup, unpacked PHP from source again, re-ran config, and then ran make and installed.

After recompiling with --with-jpeg, did you have sure the PHP module was reinstalled? Did you restart the Apache server to make sure it used the new module?

Steve
HotDrupal

HotDrupal.com’s picture

The correct compile option for PHP is:

--with-jpeg-dir

If you have a standard distro, most likely "--with-jpeg-dir=/usr"

Try that and let me know. You may need to install some package like libjpeg62-dev if you only have the libraries and not the includes/etc on your system. You didn't mention your distro so I can't say for sure.

Steve
HotDrupal

rockyrackoon’s picture

hey steve,
what's supposed to be in this directory that i direct the php to? so i'll find it's location on the linux machine, since i'm neither a linux-wiz (i'm actually a windows person ...) and a newbie at php...
thanks
yoav

rockyrackoon’s picture

yeah, i reinstalled and restarted.
the problem is only on the CAPTCHA module page, it doesn't appear in the status report screen, btw.

any more ideas?

Rocky

HotDrupal.com’s picture

So, you did you change --with-jpeg to --with-jpeg-dir=/usr .... then recompile and install?

Did you redirect the output of the ./configure to a file, and then look at the file for the lines pertaining to jpeg to see if it found the include/library files:

checking for the location of libjpeg... /usr
checking for jpeg_read_header in -ljpeg... yes

Did you redirect the output of make, and see if on the final couple/few compile lines the compile included "-ljpeg" ?

rockyrackoon’s picture

i'll do it the redirecting stuff - it's 'configure --with.......... > configure.out' right?
i'll do it after you'll tell me what's in the directory and if this syntax is correct.

thanks for your help! :)

HotDrupal.com’s picture

yes:

./configure --with-jpeg-dir=/usr -- .... > configure.out

this will still allow STDERR to go to console, so you should see errors. To be sure all is redirected, which may or may not be helpful, assuming you are using BASH as your shell:

.... > congfigure.out 2>&1

and you can do the same for make ... make > make.out 2>&1
Steve

rockyrackoon’s picture

i've done all of that, the .out files were ok, but still it doesn't work, it still displayes the message
"Images cannot be generated, because your PHP installation's GD library has no JPEG support."
in the CAPTCHA module settings.

ANY IDEA? :)

thanks
rocky

malbrecht’s picture

PHP, GD and JPEG can drive you nuts, can't it? :-)

My suggestion: DO NOT use the built in gd support in php but install gd library 2. I have set up four servers over the change of years and after loosing a couple of hours on the first trying to get the built in gd stuff working I did this:

- install jpeg package (using standard configuration it installed itself in /usr/local)
- install gd lib 2 (using standard configuration it installed itself in /usr/local)
- configure php like this: ./configure --with-mysql --enable-mbstring --with-jpeg-dir=/usr/local --with-gd=/usr/local
- make clean (important to avoid the internal gd stuff being used)
- make ; make install

Otherwise please post the content of your *.out file.

zwu_ca’s picture

./configure --with-xml --with-apxs2=/usr/sbin/apxs -with-mysql --with-m
ysqli --with-gd=/usr -with-jpeg-dir=/usr/lib --enable-gd-native-ttf --with-ttf --without-odbc --enable-dom --enable-soap --with-curl --w
ith-curl --with-iconv --enable-memory-limit --with-expat-dir=/usr --with-pcre-r
egex=/emov/3p --with-zlib --with-layout=GNU --enable-exif --enable-shmop -enable
-calendar --enable-dbx --enable-dio -with-mime-magic=/etc/httpd/conf/magic --with
out-sqlite -with-libxml-dir=/usr

It looks the important part is "--with-gd=/usr -with-jpeg-dir=/usr/lib ". I tried many other options, finally got this work for me.

malbrecht’s picture

your configure-string expects gd-lib to be installed with prefix=/usr. You should addd that as a note for the guy asking for help :-)

zwu_ca’s picture

If one uses "yum install gd-devel" on Fedora, that is where it is.

Craftsman’s picture

See those helpful notes at php.net http://ru.php.net/manual/en/image.installation.php

If you have already compiled php without jpeg support and decide you want it , then before you compile again you might need to run "make clean" first.

This one works for me (FreeBSD 7.1):

# make clean
# ./configure --with-apxs=/usr/local/sbin/apxs --with-mysqli --with-gd --enable-mbstring --with-jpeg-dir=/usr/local/lib --with-gettext
# make
# make install