GD 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

Post Reply
kevin7
Forum Commoner
Posts: 96
Joined: Fri May 21, 2004 6:54 am

GD library?

Post by kevin7 »

how can i know if i already hv GD library?
i've install php...

if not where to get it?
User avatar
pickle
Briney Mod
Posts: 6445
Joined: Mon Jan 19, 2004 6:11 pm
Location: 53.01N x 112.48W
Contact:

Post by pickle »

There's a function called [php_man]get_loaded_extensions[/php_man](), which does what it says. The website to download GD can be found on the PHP [php_man]GD[/php_man] page.
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
kevin7
Forum Commoner
Posts: 96
Joined: Fri May 21, 2004 6:54 am

Post by kevin7 »

Fatal error: Call to undefined function: imagecreatetruecolor() in c:\inetpub\wwwroot\upload\thumb.php on line 15

i get this error...
because dun hv GD library installed?
GD library not come with php installer?
kevin7
Forum Commoner
Posts: 96
Joined: Fri May 21, 2004 6:54 am

Post by kevin7 »

i using php 4.3.6
mjseaden
Forum Contributor
Posts: 458
Joined: Wed Mar 17, 2004 5:49 am

Post by mjseaden »

That's right, you need to install GD. You can check by calling phpinfo() - I can't remember the exact section you look at, but it's all pretty intuitive.

Mark
User avatar
pickle
Briney Mod
Posts: 6445
Joined: Mon Jan 19, 2004 6:11 pm
Location: 53.01N x 112.48W
Contact:

Post by pickle »

if you can get the GD dll file, there is a function called [php_man]dl[/php_man] which will allow you to dynamically load the extension at runtime.
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
redmonkey
Forum Regular
Posts: 836
Joined: Thu Dec 18, 2003 3:58 pm

Post by redmonkey »

I assume this is the Windoze installer from the PHP.net download page? and your installing on your local machine?

If so, the installer package doesn't come with any additional extensions. You can download the .zip package which has many extensions and simply extract them somewhere on your drive, then edit your php.ini file to uncomment the extensions you require and also specify the extension directory. Then restart your webserver and all should be good.
kevin7
Forum Commoner
Posts: 96
Joined: Fri May 21, 2004 6:54 am

Post by kevin7 »

mjseaden wrote:That's right, you need to install GD. You can check by calling phpinfo() - I can't remember the exact section you look at, but it's all pretty intuitive.

Mark
did u means the error i got is a sign of i don't hv GD lib installed???
User avatar
pickle
Briney Mod
Posts: 6445
Joined: Mon Jan 19, 2004 6:11 pm
Location: 53.01N x 112.48W
Contact:

Post by pickle »

Ya.
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
kevin7
Forum Commoner
Posts: 96
Joined: Fri May 21, 2004 6:54 am

Post by kevin7 »

i check the GD's website... sound complicated...
hmm... can u show me the step?
kevin7
Forum Commoner
Posts: 96
Joined: Fri May 21, 2004 6:54 am

Post by kevin7 »

what version should i download for the GD lib? if i using php 4.3.6???
User avatar
pickle
Briney Mod
Posts: 6445
Joined: Mon Jan 19, 2004 6:11 pm
Location: 53.01N x 112.48W
Contact:

Post by pickle »

Download the latest version - I'm not sure which one it is.
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
User avatar
wwwapu
Forum Contributor
Posts: 197
Joined: Wed Apr 07, 2004 11:57 am
Location: Turku, Finland

Post by wwwapu »

I recommend you do what redmonkey said extension you need is gd2 or something like that. go to http://www.php.net
User avatar
dull1554
Forum Regular
Posts: 680
Joined: Sat Nov 22, 2003 11:26 am
Location: 42:21:35.359N, 76:02:20.688W

Post by dull1554 »

if its a local server(you have access to php.ini) you may be able to load the extension. if php was installed using the installer then forget it you will have to download and install gd seperatly, but if you installed php from a zip file, you allready have the extension

go to the php.ini file located in you windows root directory(c:\windows, c:\winnt) and uncomment the line

Code: Select all

;extension=php_gd2.dll//remove the semi-colon
then restart the webserver

if apache you can restart it by opening command prompt and type "net stop apache" press enter then type "net start apache" and press enter

hope that helps
Post Reply