Gellpak

Registered
Jul 16, 2002
3
0
151
I have been informed by my server admin that to install GD manually would screw up cpanel's delicate filestructure, and that in order to facilitate the use of this feature, I need to procure the RPM build from someone or some site. I have already searched your forums and numerous other sites looking for one, with no success. The server runs Redhat Linux 7.2. If you can either build an RPM for me, explain how to do it myself, or forward me to a source that will actually assist me in this, I would be greatly appreciative.
 

moronhead

Well-Known Member
Aug 12, 2001
706
0
316
As far as I know there's no RPM for redhat.

Are you trying to use this new version with PHP? If you are I can help you.
 

Gellpak

Registered
Jul 16, 2002
3
0
151
I did find this...

http://rpmfind.net/linux/RPM/openpkg/release/1.0/BIN/gd-2.0.1-1.0.0.ix86.html

and yes, I am.
I have successfully rigged it up on my winxp development machine and it is running, but on the server we have an outdated (though the most recent stable release) version of GD running, but which will not support some of the functions I need, such as imagecopyresampled()

This page will output a thumbnail when GD 2 is working, and it may help you if you're looking for more info: http://www.kaihen.com/php/thumber.php?id=71
 

moronhead

Well-Known Member
Aug 12, 2001
706
0
316
With that RPM I think you need to set up the Open Package system on your server first, is that right? Or were you able to install the RPM over the existing version [1.84]?
 

Gellpak

Registered
Jul 16, 2002
3
0
151
Haven't tried. My admin told me that he'd only try if I could get uninstall instructions for the current one and install instructions for the new one.
 

moronhead

Well-Known Member
Aug 12, 2001
706
0
316
[quote:723a45f6d4][i:723a45f6d4]Originally posted by Gellpak[/i:723a45f6d4]

Haven't tried. My admin told me that he'd only try if I could get uninstall instructions for the current one and install instructions for the new one.[/quote:723a45f6d4]

I'd say that would create a lot of mess. I'll show you what I did when I needed to recompile PHP with GD 2 exactly for the same reasons that you now have.

Just like IMAP you don't need to install the new GD on the server to get PHP to include it in its DSO module. All you need is show PHP the compiled GD binary and it will build it from there. So here we go:

1. Grab GD-2.0.1 from here: http://www.boutell.com/gd

2. tar zxvf gd-2.0.1.tar.gz

3. cd gd-2.0.1

4. Edit the Makefile and change the LIBS line to be:
LIBS=libgd.a -lpng -lz -ljpeg -lfreetype -lm

5. make libgd.a (don't need to do a make install)

6. Now build PHP using these flags (in addition to others):
--with-gd=/path/to/gd-2.0.1
--with-freetype-dir=/usr
--enable-gd-native-ttf (for PHP 4.0.6 leave off trailing 'f')
--enable-gd-imgstrttf
--with-jpeg-dir=/usr/local
--with-png-dir=/usr/local
--with-zlib

Restart apache once you've finished recompiling PHP and all your GD blues will come to an end. :)

[i:723a45f6d4]Edited: [/i:723a45f6d4]In these steps I've assumed that you are the server admin. If you are not, then simply send these to whoever is technically responsible for your server.
 

arkain

Well-Known Member
Mar 20, 2003
93
0
156
root@server1 [~]# ./configure --with-gd=/gd-2.0.11 --with-freetype-dir=/usr --enable-gd-native-ttf --enable-gd-imgstrttf --with-jpeg-dir=/usr/local
bash: root@server1: command not found

Tried it but for some reason...it doesnt work..
 

parhelic

Well-Known Member
Oct 27, 2002
47
0
156
Gellpak,

Firstly, may I suggest hiring an administrator who knows atleast a little bit about what he's talking about :rolleyes: Compiling and installing a newer version of GD doesnt affect "cpanel's delicate filestructure" in any way, but actually you will probably not need to do this anyways as PHP 4.3.1 comes bundled with GD so you do not need to download and compile GD 2.0.11 at boutell.com any longer unless you plan to keep running PHP 4.2.X.

Follow these instructions to recompile to the latest PHP with GD support:

cd /usr/local/apache/libexec
cp libphp4.so libphp4.so.BACKUP

wget http://www.php.net/distributions/php-4.3.1.tar.gz

tar -zxvf php-4.3.1.tar.gz

cd php-4.3.1

./configure --with-apxs=/usr/local/apache/bin/apxs --with-xml --enable-bcmath --enable-calendar --with-curl --with-swf=/usr/local/flash --enable-ftp --with-gd --with-jpeg-dir=/usr/local --with-png-dir=/usr --with-xpm-dir=/usr/X11R6 --with-imap --with-imap-ssl --with-kerberos --enable-mbstring --enable-mbstr-enc-trans --enable-mbregex --with-mcrypt --enable-magic-quotes --with-mysql --with-pear --enable-sockets --enable-track-vars --with-ttf --with-freetype-dir=/usr --enable-gd-native-ttf --enable-versioning --with-zlib

make

make install

/etc/rc.d/init.d/httpd restart