PHP5 and GD version

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
User avatar
neophyte
DevNet Resident
Posts: 1537
Joined: Tue Jan 20, 2004 4:58 pm
Location: Minnesota

PHP5 and GD version

Post by neophyte »

Does anybody know whether PHP5 ever shipped with anything less than GD 2.x? Does anybody know where I could find what GD versions have shipped with PHP5?
User avatar
Ollie Saunders
DevNet Master
Posts: 3179
Joined: Tue May 24, 2005 6:01 pm
Location: UK

Post by Ollie Saunders »

Search http://www.php.net/ChangeLog-4.php for GD with match case on.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

Code: Select all

[feyd@home]/php-5.0.0>php -n -d extension_dir="./ext" -r "dl('php_gd2.dll'); var_dump(gd_info());"
array(12) {
  ["GD Version"]=>
  string(27) "bundled (2.0.23 compatible)"
  ["FreeType Support"]=>
  bool(true)
  ["FreeType Linkage"]=>
  string(13) "with freetype"
  ["T1Lib Support"]=>
  bool(false)
  ["GIF Read Support"]=>
  bool(true)
  ["GIF Create Support"]=>
  bool(false)
  ["JPG Support"]=>
  bool(true)
  ["PNG Support"]=>
  bool(true)
  ["WBMP Support"]=>
  bool(true)
  ["XPM Support"]=>
  bool(false)
  ["XBM Support"]=>
  bool(true)
  ["JIS-mapped Japanese Font Support"]=>
  bool(false)
}

[feyd@home]/php-5.0.0>php -v
PHP 5.0.0 (cli) (built: Jul 13 2004 21:39:58)
Copyright (c) 1997-2004 The PHP Group
Zend Engine v2.0.0, Copyright (c) 1998-2004 Zend Technologies
User avatar
neophyte
DevNet Resident
Posts: 1537
Joined: Tue Jan 20, 2004 4:58 pm
Location: Minnesota

Post by neophyte »

Thanks guys.

I'm aware of gd_info(), imagetypes(), load_extension() and so forth that are commonly used inconjunction with GD. I'm trying to determine what needs to be tested for with PHP5? For example, gif image types were not apart of the GD library for a few versions, would a PHP5 install bump into problems with that?

I'm guessing because the GD lib can configured as a shared library there is no telling what version of GD is installed even if the code was written for PHP5. Or am I totally wrong?

Excedrin anyone?
User avatar
neophyte
DevNet Resident
Posts: 1537
Joined: Tue Jan 20, 2004 4:58 pm
Location: Minnesota

Post by neophyte »

BTW thanks for the post Feyd.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

gd_info() contained all the information you are wanting. :?
User avatar
Ollie Saunders
DevNet Master
Posts: 3179
Joined: Tue May 24, 2005 6:01 pm
Location: UK

Post by Ollie Saunders »

and the changelog tells you when support was added for various things. Change the 4 to a 5 to see the changelog for 5.
Post Reply