how to install GD2 library

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

User avatar
itsmani1
Forum Regular
Posts: 791
Joined: Mon Sep 29, 2003 2:26 am
Location: Islamabad Pakistan
Contact:

Post by itsmani1 »

i am using PHP 4.1.1
now plz tell me can i do this stuff by using php 4.1.1
and if i can do so? how it will be handled?
User avatar
itsmani1
Forum Regular
Posts: 791
Joined: Mon Sep 29, 2003 2:26 am
Location: Islamabad Pakistan
Contact:

Post by itsmani1 »

smpdawg wrote:Is PHP loading now? What problem are you having?
ya its loading with out any issue
my every thing is working but when i try to use the script it says:
:::::::::::::::::::::::::::::::::::::::::::::::::
RESIZED IMAGE:
<img src="
Fatal error: Call to undefined function: imagecreatefromjpeg() in c:\apache\htdocs\image_resize\image_resize\sample_of_script_in_use\resize.php on line 32
User avatar
smpdawg
Forum Contributor
Posts: 292
Joined: Thu Jan 27, 2005 3:10 pm
Location: Houston, TX
Contact:

Post by smpdawg »

Run phpinfo() and see if GD actually loaded. There should be some reference to it on that page that phpinfo generates.
User avatar
itsmani1
Forum Regular
Posts: 791
Joined: Mon Sep 29, 2003 2:26 am
Location: Islamabad Pakistan
Contact:

Post by itsmani1 »

no its not running ::
User avatar
smpdawg
Forum Contributor
Posts: 292
Joined: Thu Jan 27, 2005 3:10 pm
Location: Houston, TX
Contact:

Post by smpdawg »

That is odd. You don't get any errors from PHP when you restart Apache? And you have added the extension for GD to your php.ini?

Look at phpinfo and verify that the ini it is using is the same one that you are editting. I have seen various PHP installers that modify the location of the ini.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

...and make sure the gd extension is uncommented from the extension list (if it was already there)
User avatar
itsmani1
Forum Regular
Posts: 791
Joined: Mon Sep 29, 2003 2:26 am
Location: Islamabad Pakistan
Contact:

Post by itsmani1 »

no have changed my ini file thats' y its not giving any errors
and my php is stable :

can u guide me how to start fresh installation of GD on php 4.1.1 with apache 1.2 on win xp ?
User avatar
itsmani1
Forum Regular
Posts: 791
Joined: Mon Sep 29, 2003 2:26 am
Location: Islamabad Pakistan
Contact:

Post by itsmani1 »

smpdawg wrote:That is odd. You don't get any errors from PHP when you restart Apache? And you have added the extension for GD to your php.ini?

Look at phpinfo and verify that the ini it is using is the same one that you are editting. I have seen various PHP installers that modify the location of the ini.
there is no problem to my ini file
its doing the business, now wot is want is to install a fresh copy in GD on my php 4.1.1
User avatar
itsmani1
Forum Regular
Posts: 791
Joined: Mon Sep 29, 2003 2:26 am
Location: Islamabad Pakistan
Contact:

Post by itsmani1 »

feyd wrote:...and make sure the gd extension is uncommented from the extension list (if it was already there)
now if i uncomment my GD extensions it gives my error =>gd not available
User avatar
itsmani1
Forum Regular
Posts: 791
Joined: Mon Sep 29, 2003 2:26 am
Location: Islamabad Pakistan
Contact:

Post by itsmani1 »

now status is :
that i have added 'php_gd.dll' to extensions folder and uncommented it in .ini file let see

and i got:::
Fatal error: imagecreatetruecolor(): requires GD 2.0 or later in
on result page[/quote]
Last edited by itsmani1 on Sat Mar 05, 2005 1:21 am, edited 1 time in total.
User avatar
smpdawg
Forum Contributor
Posts: 292
Joined: Thu Jan 27, 2005 3:10 pm
Location: Houston, TX
Contact:

Post by smpdawg »

This note was found on the php web site. Check each step that is listed and let me know what happens.
Installing GD extension on Windows:

First you need to download PHP 4.3.x zip package not the PHP 4.3.x installer! PHP 4.3.x zip package has extensions included already.

Follow the instructions on installing PHP at install.text.

If PHP is already working, you may now activate the GD by doing the following:

1. Uncomment the - extension_dir="". Then you should point it to where the extensions folder is located. Extensions folder is extracted from PHP zip file you downloaded.
Example: extension_dir = C:/PHP/extensions

2. Uncomment the following by removing the semicolon -
Example: extension=php_gd2.dll

3. Test if GD extension is already loaded by executing the following lines:
<?php
var_dump(gd_info());
?>

Hope this helps!
Post Reply