[vox-tech] php/GD problems (sorry for duplicate post)

Dave Margolis vox-tech@lists.lugod.org
Wed, 14 Apr 2004 13:35:07 -0700


Mark,

Great tip.  I hadn't seen/used that before.

By the way:

<?php
echo "<pre>";
var_dump(gd_info());
echo "</pre>";
?>

does a slightly better job showing your what you're looking at.


Dylan,

I know nothing about what the default debian package for php supports, 
but the default slackware and redhat/fedora php packages are basically 
useless because they assume a fairly generic interface.  Compiling your 
own php next to an existing apache install is very straightforward, and 
will allow you to fine-tune your php to do exactly what you want.  This 
also allows you to keep up with php versions if they stay ahead of what 
debian considers stable (or testing).

Since GD support is built in (but not turned on) to newer versions of 
PHP, configure php with something like the following:

./configure --with-apxs --with-gd -with-jpeg-dir=/usr        
 --with-png-dir=/usr --with-tiff-dir=/usr 
--with-freetype-dir=/usr/local  --with-zlib-dir=/usr

(then make and make install)

This assumes png, jpeg, tiff, freetype, and libz are all installed with 
libs in /usr/lib.  And of course, you can add a lot more or less (for 
example, I also use XML, PDFLib, FTP, and a few other goodies).
The above gives me a fully functioning GD installation (except for GIF 
write support).

Note that some manual tweakage of httpd.conf will be necessary to make 
php work if you pull debian's package and compile yourself, and that 
mostly looks like this:

LoadModule php4_module        libexec/libphp4.so
(where the other loadmodule stuff is)

AddModule mod_php4.c
(where the other addmodule stuff is)

AddType application/x-httpd-php .php
(where any other addtypes are)

You may also want to add "index.php" and/or "default.php" to the default 
directory types under the mod_dir declaration.

Hope that helps,
Dave



Dave

Mark K. Kim wrote:

>What do you get with:
>
>   <?php var_dump(gd_info()); ?>
>
>?  If you get error, then GD isn't properly interfaced with PHP.  Also, it
>should show you which image types it supports.
>
>-Mark
>
>
>On Tue, 13 Apr 2004, dylan wrote:
>
>  
>
>>hi-
>>
>>i am running debian/stable with the default install of PHP and GD version
>>2... i notice that when i run the phpinfo() function i see that there is an
>>entry : --with-gd=shared,/usr .... this would lead me to believe that it
>>would be possible to use the GD image creation functions with php...
>>
>>however trying to use imagecreate() results in an undefined function error.
>>
>>i know that i have the GD libs installed, but how can i make PHP use them?
>>
>>any ideas?
>>
>>thanks in advance
>>
>>Dylan
>>
>>PS: i should mention that i am looking for some ways of messing with limited
>>RGB - HVC color space conversion...namely the limited earth tones that are
>>used in soil classification. php might not be the best way to do this...
>>
>>_______________________________________________
>>vox-tech mailing list
>>vox-tech@lists.lugod.org
>>http://lists.lugod.org/mailman/listinfo/vox-tech
>>
>>    
>>
>
>  
>