Click to See Complete Forum and Search --> : Problem getting GD to work under Linux


Gilgamesh
07-10-2003, 04:36 PM
It seems like GD should work, but it doesn't...

In my phpinfo():
-----------
Configure Command './configure' '--with-apxs2=/usr/local/apache2/bin/apxs' '--with-mysql=/usr/local/mysql/' '--with-gd' '--with-zlib' '--with-config-file-path=/etc'

gd
GD Support enabled
GD Version bundled (2.0.12 compatible)
GIF Read Support enabled
PNG Support enabled
WBMP Support enabled
XBM Support enabled
-----------

But I keep getting errors like these:
------------
Call to undefined function: imagejpeg()
Call to undefined function: imagecreatefromjpeg()
------------

It doesn't, however, give me an undefined function call to other image functions, like imagesx and imagesy.

Any ideas on why it isn't working?

Note that every other aspect of php and mysql are working under this configuration.

stolzyboy
07-10-2003, 05:16 PM
in order for jpg support, it needs to say

"JPG Support enabled"

Gilgamesh
07-10-2003, 05:19 PM
Great, what do I need to do to get jpeg support installed?

pheeh
07-10-2003, 08:51 PM
What version of GD are you running? I would suggest upgrading to the newest version, I've had trouble with various jpg requests with the previous versions of GD, but once I went to version 2.0.11 all of these problems seem to dissipate. Also, when you look at the phpinfo() make sure that support for jpeg is enabled, it seems to me that you are having troubles with the JPEG support. You can download the version that I mentioned above from:

gd-2.0.11.tar.gz (http://lostinthedesert.com/hrmm/gd-2.0.11.tar.gz)

It is setup for jpg, gif, and png support. Let me know if this helps.

pheeh
07-10-2003, 08:57 PM
OK...so I read through the previous posts a little too fast. To compile in this feature run:

tar -zxvf gd-2.0.11.tar.gz
cd into dir.
./configure
make
make install

then in the php config line just include:
--with-gd
or....
--with-/path/to/gd/dir

depending on if you get errors in the php configure.

That should be about it, let me know if I missed anything.

goldbug
07-11-2003, 10:31 AM
Not sure it'll make a difference, but have you tried manually specifying the path to libjpeg when you run configure?

For example, in my case, I would add:

--with-jpeg-dir=/usr/local

jstarkey
07-13-2003, 12:44 PM
Have you installed the jpeg libraries on your box?

http://us3.php.net/gd links to them, if you haven't.