Page 1 of 1

gd support

Posted: Fri Nov 25, 2005 8:07 pm
by s.dot
Note: Since PHP 4.3 there is a bundled version of the GD lib. This bundled version has some additional features like alpha blending, and should be used in preference to the external library since its codebase is better maintained and more stable.
I am using 4.4.1 so I have the bundled version. I was told I will have to recompile PHP to enable GD. Is this true? Or can I just configure something?

php.net/gd says this
To enable GD-support configure PHP --with-gd[=DIR], where DIR is the GD base install directory. To use the recommended bundled version of the GD library (which was first bundled in PHP 4.3.0), use the configure option --with-gd. GD library requires libpng and libjpeg to compile.
Which seems completely foreign to me. :-P

Posted: Fri Nov 25, 2005 8:58 pm
by josh
configure is a process in compiling

Code: Select all

./configure --with-gd
make
make install

Posted: Fri Nov 25, 2005 9:12 pm
by s.dot
do this in my php directory?

Posted: Fri Nov 25, 2005 9:44 pm
by josh
type that in the command line, but first you need the PHP source

Posted: Sat Nov 26, 2005 11:35 am
by Chris Corbyn
What operating system are you using? Some package management systems will let you specify that configuration. Gentoo for example:

Code: Select all

linux # USE="gd" emerge dev-lang/php
If you're using something like red hat or an RPM based system I would never install PHP using the package managers. Download the source code (.tar.gz) from the PHP website, extract the sources (tar -xvzf php-<version>.tar.gz), and then go into the directory it creates and run the configure with any options you need before installing. Like jshpro2 said:

Code: Select all

linux #  ./configure --help  #Take a look at the various options available
linux #  ./configure --with-gd --with-mysql=/usr/local/mysql --with-apxs2=/usr/local/apache2/bin/apxs
linux #  make
linux #  make install
The above is just an example... you can have whatever options at the ./configure command that you need. If you want to know where all the files are going to end up more easily....

Code: Select all

linux #  ./configure --prefix=/usr/local/php