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
Restart?
--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
Figured it out ... with-jpeg-dir, not with-jpeg
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
Steve...
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
restarted, reinstalled...
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
Yes
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:
Did you redirect the output of make, and see if on the final couple/few compile lines the compile included "-ljpeg" ?
I'll do that
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! :)
Correct
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
so i've done all that...
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
PHP, GD and JPEG can drive
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.
For Fedora, Php 5.2.3, you may try this:
./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.
your configure-string
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 :-)
Yes, the dir is the gd library default place for Fedora
If one uses "yum install gd-devel" on Fedora, that is where it is.
Try to run "make clean" before ./configure...
See those helpful notes at php.net http://ru.php.net/manual/en/image.installation.php
This one works for me (FreeBSD 7.1):