Attempt to compile PHP 5.2.0 with mysql and gd (2.0.33)

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
Hello newsgroup members,

I had an install of php without gd, this seemed to work ok.  I decided
I would like to use the gd package with php.  I have Redhat 3.0AS, and
php 5.2.0, and gd-2.0.33.  the phpinfo file looks like it has gd (shows
up in info page).

I get a failure running one of the gd functions:
Fatal error: Call to undefined function imagecreatefromjpeg() in
usr/local/apache2/htdocs/thumbnail_generator.php on line 42

That function is supposed to be ok in gd.

I assume that I must start all over.  What directory should I be using
for --with-gd=/??????
I have tried the unzipped location (gd-2.0.33) where i do the
./configure, etc - the php config fails, saying it cannot find
libgd.(a|so) (which is in .libs) or at times gd.h.  I have used
/usr/lib as well - seems everything fails in some form.  I am using
apache 2.0.  How can I remove php 5.2, and gd, and start over

I followed the install and readmes for both php and gd - but no luck.

Any tips or experience with help.


Re: Attempt to compile PHP 5.2.0 with mysql and gd (2.0.33)

There are 2 possible solutions :

1. The simple one: The PHP source tree contains a GD library. If you want  
to use it (and I don't see why you wouldn't), just add '--with-gd' or  
'--with-gd=shared' to your configure line. Then run 'make' and the  
embedded GD library will be compiled and linked with your PHP.

2. The more complex one. If you don't want to use the embedded GD library,  
you will have to expand the GD sources, run configure in this directory,  
compile, link , install GD, and only after this, you will run configure in  
the PHP source tree and add '--with-gd=<dir>' where <dir> is the directory  
GD was installed in (not the directory of the sources).

Now, something else: if you want to use imagecreatefromjpeg, you will need  
the jpeg library, even if you link PHP with its embedded GD library.  
There, it becomes quite complex to explain here.

Read the document at : it  
is a step by step tutorial explaining how to build a complete Apache/PHP  
environment on Linux RHEL 3. The document was validated with PHP 5.1.6 but  
it should be OK for 5.2.


Quoted text here. Click to load it

Utilisant le client e-mail r√©volutionnaire d'Opera :

Site Timeline