Source of: /manual/en/image.installation.php
<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/image.setup.inc";
$setup = array (
'home' =>
array (
0 => 'index.php',
1 => 'PHP Manual',
),
'head' =>
array (
0 => 'UTF-8',
1 => 'en',
),
'this' =>
array (
0 => 'image.installation.php',
1 => 'Installation',
),
'up' =>
array (
0 => 'image.setup.php',
1 => 'Installing/Configuring',
),
'prev' =>
array (
0 => 'image.requirements.php',
1 => 'Requirements',
),
'next' =>
array (
0 => 'image.configuration.php',
1 => 'Runtime Configuration',
),
);
$setup["toc"] = $TOC;
$setup["parents"] = $PARENTS;
manual_setup($setup);
manual_header();
?>
<div id="image.installation" class="section">
<h2 class="title">Installation</h2>
<p class="para">
To enable GD-support configure PHP
<span class="option">--with-gd[=DIR]</span>, where DIR is the GD base
install directory. To use the recommended bundled version of the GD library
(which was first bundled in PHP 4.3.0), use the configure option
<span class="option">--with-gd</span>.
GD library requires <span class="productname">libpng</span> and
<span class="productname">libjpeg</span> to compile.
</p>
<p class="para">
In Windows, you'll include the GD2 DLL <var class="filename">php_gd2.dll</var> as
an extension in <var class="filename">php.ini</var>. The GD1 DLL <var class="filename">php_gd.dll</var> was
removed in PHP 4.3.2. Also note that the preferred truecolor image
functions, such as <a href="function.imagecreatetruecolor.php" class="function">imagecreatetruecolor()</a>, require GD2.
</p>
<p class="para">
Enhance the capabilities of GD to handle more image formats by specifying
the <i>--with-XXXX</i> configure switch to your PHP configure
line.
</p><table class="doctable table">
<caption><b>Supported image formats</b></caption>
<thead valign="middle">
<tr valign="middle">
<th>Image Format</th>
<th>Configure Switch</th>
</tr>
</thead>
<tbody valign="middle" class="tbody">
<tr valign="middle">
<td align="left"><i>jpeg-6b</i></td>
<td align="left">
To enable support for jpeg-6b add
<span class="option">--with-jpeg-dir=DIR</span>.
</td>
</tr>
<tr valign="middle">
<td align="left"><i>png</i></td>
<td align="left">
To enable support for png add
<span class="option">--with-png-dir=DIR</span>. Note, libpng
requires the <a href="zlib.requirements.php" class="link">zlib library</a>,
therefore add <span class="option">--with-zlib-dir[=DIR]</span>
to your configure line.
</td>
</tr>
<tr valign="middle">
<td align="left"><i>xpm</i></td>
<td align="left">
To enable support for xpm add
<span class="option">--with-xpm-dir=DIR</span>. If configure
is not able to find the required libraries, you may add the path to
your X11 libraries.
</td>
</tr>
</tbody>
</table>
<p>
</p><blockquote><p><b class="note">Note</b>:
<span class="simpara">
When compiling PHP with libpng, you must use the same version that was
linked with the GD library.
</span>
</p></blockquote><p>
</p>
<p class="para">
Enhance the capabilities of GD to deal with different fonts by specifying
the <i>--with-XXXX</i> configure switch to your PHP configure
line.
</p><table class="doctable table">
<caption><b>Supported font libraries</b></caption>
<thead valign="middle">
<tr valign="middle">
<th>Font library</th>
<th>Configure Switch</th>
</tr>
</thead>
<tbody valign="middle" class="tbody">
<tr valign="middle">
<td align="left"><i>FreeType 1.x</i></td>
<td align="left">
To enable support for FreeType 1.x add
<span class="option">--with-ttf[=DIR]</span>.
</td>
</tr>
<tr valign="middle">
<td align="left"><i>FreeType 2</i></td>
<td align="left">
To enable support for FreeType 2 add
<span class="option">--with-freetype-dir=DIR</span>.
</td>
</tr>
<tr valign="middle">
<td align="left"><i>T1lib</i></td>
<td align="left">
To enable support for T1lib (Postscript Type 1 fonts) add
<span class="option">--with-t1lib[=DIR]</span>.
</td>
</tr>
<tr valign="middle">
<td align="left"><i>Native TrueType string function</i></td>
<td align="left">
To enable support for native TrueType string function add
<span class="option">--enable-gd-native-ttf</span>.
</td>
</tr>
</tbody>
</table>
<p>
</p>
</div><?php manual_footer(); ?>