[ Team LiB ] |
![]() ![]() |
Checking Your Configuration with gd_info()Although the GD library is bundled with PHP, some features (such as JPEG support, for example) require external libraries. You can see which features PHP is compiled to support with the gd_info() function. gd_info() requires no arguments and returns an associative array describing your GD setup. Table 15.1 lists the elements of the array returned by gd_info(). We can run gd_info() in a script like so: print "<pre>"; print_r( gd_info() ); print "</pre>"; Notice that we output the array using print_r() and maintain formatting by wrapping our output in a <pre> element. On our system the output looks like this: Array ( [GD Version] => bundled (2.0.15 compatible) [FreeType Support] => 1 [FreeType Linkage] => with TTF library [T1Lib Support] => [GIF Read Support] => 1 [GIF Create Support] => [JPG Support] => 1 [PNG Support] => 1 [WBMP Support] => 1 [XPM Support] => [XBM Support] => 1 [JIS-mapped Japanese Font Support] => ) We can see from this output that it would be a mistake to attempt to output a GIF file, but we can work with the JPEG and PNG formats. |
[ Team LiB ] |
![]() ![]() |