l i n u x - u s e r s - g r o u p - o f - d a v i s
L U G O D
 
Next Meeting:
July 21: Defensive computing: Information security for individuals
Next Installfest:
TBD
Latest News:
Jul. 4: July, August and September: Security, Photography and Programming for Kids
Page last updated:
2004 Apr 15 19:07

The following is an archive of a post made to our 'vox-tech mailing list' by one of its subscribers.

Report this post as spam:

(Enter your email address)
Re: [vox-tech] php/GD problems (sorry for duplicate post)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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



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



_______________________________________________
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech



LinkedIn
LUGOD Group on LinkedIn
Sign up for LUGOD event announcements
Your email address:
facebook
LUGOD Group on Facebook
'Like' LUGOD on Facebook:

Hosting provided by:
Sunset Systems
Sunset Systems offers preconfigured Linux systems, remote system administration and custom software development.

LUGOD: Linux Users' Group of Davis
PO Box 2082, Davis, CA 95617
Contact Us

LUGOD is a 501(c)7 non-profit organization
based in Davis, California
and serving the Sacramento area.
"Linux" is a trademark of Linus Torvalds.

Sponsored in part by:
O'Reilly and Associates
For numerous book donations.