Jump to content

Archived

This topic is now archived and is closed to further replies.

abdfahim

[SOLVED] How can I install GD library 2

Recommended Posts

I m new to this world. I installed PHP+mysql+Apache server (from internet tutorial). I got the ZIP file of GD library 2.0.33 downloaded. Now how can I install GD library? My php version is 5.0.4. Plz help me

Share this post


Link to post
Share on other sites
What os are you using?

[b]EDIT[/b] I guess that I should have read the post better..lol 

Sorry,

      Anyways, you need to enable the gd2.dll in your php.ini

here is an example.

[code]
;Windows Extensions
;Note that ODBC support is built in, so no dll is needed for it.
;
extension=php_gd2.dll
[/code]

Hope this helps,
Tom

Share this post


Link to post
Share on other sites
I am sorry that I forgot to mention my OS. It is Windows XP. And I install Apache server (think i told it already). And the bad news is even after I uncomment the line like ..
extension=php_gd2.dll

phpinfo() page does not show any information of GD.

Share this post


Link to post
Share on other sites
look in your extension directory and see if you have the gd2.dll or you can use the search function from the start menu. If not then you may have to download it.

Share this post


Link to post
Share on other sites
^beat me to it..lol  You can try this simple image code

[code]
<?php
$list = array("1","2","3","4","5","6","7","8","9","0");

for ($i = 1; $i <= 6; $i++) {
$generated_code .= $list[rand(0,9)];
}

$im = @imagecreate (65, 24)
or die ("Cannot create code - please try later");
$background_color = imagecolorallocate ($im, 70, 70, 70);
$text_color = imagecolorallocate ($im, 255, 255, 255);
imagestring ($im, 5, 5, 5, $generated_code, $text_color);
imagepng ($im);
imagedestroy($im);
?>[/code]

You can create a link to this just like anyother image
<img border="0" src="image.php" width="150" height="40">

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.