php.ini and GD on Linux

Whether you are using Linux on the desktop or as a server, it's still good that you're using Linux. Linux related questions go here.

Moderator: General Moderators

Post Reply
User avatar
kanshou
Forum Commoner
Posts: 47
Joined: Sun Aug 03, 2003 1:57 pm
Location: San Diego
Contact:

php.ini and GD on Linux

Post by kanshou »

Just curious, what else do I have to do to get GD to work on linux besides uncommenting the GD line in the php.ini file?
qads
DevNet Resident
Posts: 1199
Joined: Tue Apr 23, 2002 10:02 am
Location: Brisbane

Post by qads »

um...i am very new to linux...but dont you have to recomplie php or something? 8O
User avatar
scorphus
Forum Regular
Posts: 589
Joined: Fri May 09, 2003 11:53 pm
Location: Belo Horizonte, Brazil
Contact:

Post by scorphus »

You will have to install php4-gd2 PHP4 module which depends on:

php4-gd - GD module (with GD2) for php4
libc6 - GNU C Library: Shared libraries and Timezone data
libfreetype6 - FreeType 2 font engine, shared library files
libgd2-xpm - GD Graphics Library version 2
libjpeg62 - The Independent JPEG Group's JPEG runtime library
libpng12-0 - PNG library - runtime
t1lib1 - Type 1 font rasterizer library - runtime
xlibs - X Window System client libraries
zlib1g - compression library - runtime

What distro are you running?
User avatar
kanshou
Forum Commoner
Posts: 47
Joined: Sun Aug 03, 2003 1:57 pm
Location: San Diego
Contact:

Post by kanshou »

Running redhat 7 something. I'm not entirely sure because its not my box, its one of my co-workers. and yah it is gd2 that I will need. Where do I put all these files?

One other thing WAY off topic, I'm looking for a good hosting company that is ~10/mo and gives me about 500MB of space with phpMyAdmin control.

Thanks
User avatar
scorphus
Forum Regular
Posts: 589
Joined: Fri May 09, 2003 11:53 pm
Location: Belo Horizonte, Brazil
Contact:

Post by scorphus »

I'm not very familiar with Red Hat's package management system (RPM) but I think it can handle dependency between packages and install/upgrade what is necessary.
User avatar
kanshou
Forum Commoner
Posts: 47
Joined: Sun Aug 03, 2003 1:57 pm
Location: San Diego
Contact:

Post by kanshou »

So that huge list of items was packages that need to be installed to make that GD2 work? Where do I put the GD2 file? Or am I speaking alien right now? ^_^;
User avatar
scorphus
Forum Regular
Posts: 589
Joined: Fri May 09, 2003 11:53 pm
Location: Belo Horizonte, Brazil
Contact:

Post by scorphus »

1. You need to instal php4-gd PHP module, but it depends on those other packages, therefore you have to install/upgrade them also.

2. The .rpm file internal installation script will copy all necessary files to suitable directories.

Does RedHat run APT? Please, type this command: 'apt-get' and tell us what you get.
User avatar
kanshou
Forum Commoner
Posts: 47
Joined: Sun Aug 03, 2003 1:57 pm
Location: San Diego
Contact:

Post by kanshou »

Unfortuneately the answer to that post will have to wait until monday mid-morning PST, because the office the box is in is now locked :( But I will try what you have suggested. Thanks!
User avatar
Pyrite
Forum Regular
Posts: 769
Joined: Tue Sep 23, 2003 11:07 pm
Location: The Republic of Texas
Contact:

Post by Pyrite »

Actually the only *required* libs for gd2 are libpng and zlib, and jpeg-6b or higher if you want jpeg support.

If you compile php from source, you only need to simply add --enable-gd to the ./configure line.
User avatar
scorphus
Forum Regular
Posts: 589
Joined: Fri May 09, 2003 11:53 pm
Location: Belo Horizonte, Brazil
Contact:

Post by scorphus »

Ok, I'm looking forward hearing from you. I also hope some other forum user more familiar with RedHat may help us on this matter.
User avatar
Pyrite
Forum Regular
Posts: 769
Joined: Tue Sep 23, 2003 11:07 pm
Location: The Republic of Texas
Contact:

Post by Pyrite »

I agree, I haven't used Redhat since '99. (sorry).

May be the GD website might be of some use just in case:

http://www.boutell.com/gd/
Joseph_Han
Forum Newbie
Posts: 2
Joined: Mon Feb 02, 2004 1:35 am
Location: Beijing China

Looks it is so difficult to install the GD module.

Post by Joseph_Han »

It has drove me crazy, I will discard, and turn into re-compile the PHP and Apache... :evil:

And I am suspecting if it is OK for copying gd.so from another machine.
Joseph_Han
Forum Newbie
Posts: 2
Joined: Mon Feb 02, 2004 1:35 am
Location: Beijing China

My way to compile GD modules for PHP in Linux(Redhat)

Post by Joseph_Han »

Wish this could help you little, that is my pleasure, because I have suffered from installing these modules and finding these modules from internet.

In this case, I just want to enable gif,jpeg for GD. and I think the compile way(using tar.gz package) is better than using rpm package...

1> where to get these modules

wget http://www.boutell.com/gd/http/gd-1.8.4.tar.gz
or wget http://www.boutell.com/gd/http/gd-2.0.11.tar.gz
wget ftp://ftp.rhyme.com.au/pub/gd/gd-1.8.3gif.tar.gz
or wget ftp://ftp.rhyme.com.au/pub/gd/gd-2.0.1gif.tar.gz
wget http://www.libpng.org/pub/png/src/libpng-1.0.15.tar.gz
wget http://www.gzip.org/zlib/zlib-1.1.4.tar.gz

2>
---------------------------------
1) Install zlib
- tar -zxf zlib.tar.gz
- cd zlib-1.1.3
- ./configure
- make test
- make install

2) Install libjpeg
- tar -zxf jpegsrc.v6b.tar.gz
- cd jpeg-6b
- ./configure
- make
- make test
- make install
- make install-lib
- make install-headers

3) tar xvzf the gif package, and don't touch it, leave the folder there.
---------------------------------------------------------
when complie PHP....

4)./configure --prefix=/usr/local/php --with-apache=sourcefolder --with-gd --with-
gif-dir=sourcefolder --enable-track-vars --with-jpeg-dir=/usr/local --with-zlib-dir=/usr/local/ayae
r/zlib --with-mysql --enable-ftp

5) make, make install.....


Totally, I think if you want to enable png,wbmp,pdf...., juse add the right parameters, but in my sense, where to download the package is the big issue.

Wish this could help you some.. Good Luck!


:) Joseph Han.
User avatar
scorphus
Forum Regular
Posts: 589
Joined: Fri May 09, 2003 11:53 pm
Location: Belo Horizonte, Brazil
Contact:

Post by scorphus »

What would I do without you, apt!?!?

$ apt-get update
$ apt-get install php4-gd2

and everything work smooth...

hit http://www.debian.org,
Scorphus
User avatar
ol4pr0
Forum Regular
Posts: 926
Joined: Thu Jan 08, 2004 11:22 am
Location: ecuador

Post by ol4pr0 »

you dont need to use $prefix with php.. default of $prefix=/usr/local/lib
Post Reply