By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,347 Members | 1,390 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,347 IT Pros & Developers. It's quick & easy.

Problem related to Gd library

P: 71
I have PHP 4.1.1, and i need to use php GD library. From where i can get it. my verson will support it or not.
Feb 15 '07 #1
Share this Question
Share on Google+
8 Replies

P: 71
Sorry friends my PHP verson is 4.3.11.
Feb 15 '07 #2

P: 99
To enable GD-support configure PHP --with-gd[=DIR] (

if you want it on your own computer try xampp or wamp5 for easy installing everything you need.
Feb 15 '07 #3

P: 202
if you don't have the GD library you can get it from
Feb 15 '07 #4

Expert 2.5K+
P: 3,235
How did you install PHP?

Check phpinfo() to see if GD is already installed. It comes bundled with most installations of PHP.
Feb 16 '07 #5

P: 71
Dear Motoma

i have allready checked phpinfo() to see it. GD did not install.
Feb 17 '07 #6

Expert 2.5K+
P: 3,235
Okay, what operating system are you using? How did you install PHP? From source? Binary distribution? Package Manager?
Feb 17 '07 #7

P: 1

I'm in PHP Version 4.4.4 and the configure command contains: (checking through <?php phpinfo()?>

'../configure' '--with-pear' '--with-mysql=/usr' '--with-zlib' '--enable-debug=no' '--enable-safe-mode=no' '--enable-discard-path=no' '--with-gd' '--with-png-dir=/usr/lib' '--enable-track-vars' '--with-db' '--with-gdbm' '--enable-force-cgi-redirect' '--with-ttf=/usr/' '--enable-ftp' '--with-mcrypt' '--enable-dbase' '--enable-memory-limit' '--enable-calendar' '--enable-wddx' '--with-jpeg-dir=/usr/src/kundenserver/jpeg-6b' '--enable-bcmath' '--enable-gd-imgstrttf' '--enable-shmop' '--enable-mhash' '--with-mhash=/usr/src/kundenserver/mhash-0.8.9/' '--with-openssl' '--enable-xslt' '--with-xslt-sablot' '--with-dom' '--with-dom-xslt' '--with-dom-exslt' '--with-imap' '--with-curl' '--with-iconv=/usr/local' '--with-freetype-dir=/usr/include/freetype2' '--with-bz2' '--with-gettext' '--enable-exif' '--with-idn' '--enable-mbstring=all'

Though I can see '--with-gd'...but when I run gd proglrm as below (and other examples from gd library site, all the results are a lot of unreadable code not drawing. I'm in 1and1 php server. How can I enable gd library? Please help. Thanks!

Header("Content-type: image/png");
$height = 300;
$width = 300;
$im = ImageCreate($width, $height);
$bck = ImageColorAllocate($im, 10,110,100);
$white = ImageColorAllocate($im, 255, 255, 255);
ImageFill($im, 0, 0, $bck);
ImageLine($im, 0, 0, $width, $height, $white);
for($i=0;$i<=299;$i=$i+10) {
ImageLine($im, 0, $i, $width, $height, $white); }
Apr 3 '07 #8

Expert 2.5K+
P: 3,235
Move your header call down just before ImagePNG(). This will allow you to receive error messages if the GD functions fail.
Apr 3 '07 #9

Post your reply

Sign in to post your reply or Sign up for a free account.