l i n u x - u s e r s - g r o u p - o f - d a v i s
Next Meeting:
July 7: Social gathering
Next Installfest:
Latest News:
Jun. 14: June LUGOD meeting cancelled
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)


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

By the way:

echo "<pre>";
echo "</pre>";

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


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,


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.


On Tue, 13 Apr 2004, dylan wrote:


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


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 mailing list

LUGOD Group on LinkedIn
Sign up for LUGOD event announcements
Your email address:
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:
EDGE Tech Corp.
For donating some give-aways for our meetings.