<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = 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 => 'ja',
  ),
  'this' => 
  array (
    0 => 'image.installation.php',
    1 => 'インストール手順',
    2 => 'インストール手順',
  ),
  'up' => 
  array (
    0 => 'image.setup.php',
    1 => 'インストール/設定',
  ),
  'prev' => 
  array (
    0 => 'image.requirements.php',
    1 => '要件',
  ),
  'next' => 
  array (
    0 => 'image.configuration.php',
    1 => '実行時設定',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'ja',
    'path' => 'reference/image/configure.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="image.installation" class="section">
 <h2 class="title">インストール手順</h2>
 <p class="para">
  PHPでGDサポートを有効にするには、configure に<strong class="option configure">--with-gd[=DIR]</strong>を指定します。ただし、DIRは
  GDのベースインストールディレクトリです。
  PHPにバンドルされている推奨のGDライブラリを使用するには
  <strong class="option configure">--with-gd</strong>を指定します。
  GD ライブラリをコンパイルするには、<span class="productname">libpng</span> と
  <span class="productname">libjpeg</span> が必要です。
  PHP 7.4.0 以降では、<strong class="option configure">--with-gd</strong> は
  <strong class="option configure">--enable-gd</strong>
  (gd 拡張モジュールを有効にするかどうかを指定する) と
  <strong class="option configure">--with-external-gd</strong>
  (バンドル版の libgd ではなく、外部の <span class="productname">libgd</span>
  を使うように指定する) に変わりました。
 </p>
 <p class="para">
  Windows の場合、GD DLL <var class="filename">php_gd.dll</var> を <var class="filename">php.ini</var> に
  拡張モジュールとして指定してください。
  PHP 8.0.0 より前のバージョンでは、DLL の名前は
  <var class="filename">php_gd2.dll</var> でした。
 </p>
 <p class="para">
  より多くの画像フォーマットを扱えるようにGDの能力を高めるには、
  <code class="literal">--with-XXXX</code>のような形のオプションを指定します。
  <table class="doctable table">
   <caption><strong>サポートされる画像フォーマット</strong></caption>
   
    <thead>
     <tr>
      <th>画像フォーマット</th>
      <th>configure オプション</th>
     </tr>

    </thead>

    <tbody class="tbody">
     <tr>
      <td><code class="literal">avif</code></td>
      <td>
       avif をサポートするには
       <strong class="option configure">--with-avif</strong>
       を指定します。PHP 8.1.0 以降で利用可能です。
      </td>
     </tr>

     <tr>
      <td><code class="literal">jpeg</code></td>
      <td>
       jpeg をサポートするには
       <strong class="option configure">--with-jpeg-dir=DIR</strong>
       を指定します。Jpeg 6b、7、そして 8 に対応しています。
       PHP 7.4.0 以降では、
       <strong class="option configure">--with-jpeg</strong> を代わりに使って下さい。
      </td>
     </tr>

     <tr>
      <td><code class="literal">png</code></td>
      <td>
       PNGをサポートするには<strong class="option configure">--with-png-dir=DIR</strong>
       を指定します。ただし、libpngは<a href="zlib.requirements.php" class="link">zlibライブラリ</a>を
       必要とするため、<strong class="option configure">--with-zlib-dir[=DIR]</strong>
       もconfigureオプションに追加する必要があります。
       PHP 7.4.0 以降、
       <strong class="option configure">--with-png-dir</strong> と
       <strong class="option configure">--with-zlib-dir</strong> は削除されました。
       <span class="productname">libpng</span> と <span class="productname">zlib</span> は必須になっています。
      </td>
     </tr>

     <tr>
      <td><code class="literal">xpm</code></td>
      <td>
       XPMをサポートするには<strong class="option configure">--with-xpm-dir=DIR</strong>
       を指定します。必要なライブラリをconfigureが見つけられなかった場合は
       X11ライブラリのパスを追加してください。
       PHP 7.4.0 以降では、
       <strong class="option configure">--with-xpm</strong> を代わりに使って下さい。
      </td>
     </tr>

     <tr>
      <td><code class="literal">webp</code></td>
      <td>
       webp をサポートするには
       <strong class="option configure">--with-webp-dir=DIR</strong>
       を追加してください。
       PHP 7.4.0 以降では、
       <strong class="option configure">--with-webp</strong> を代わりに使って下さい。
      </td>
     </tr>

    </tbody>
   
  </table>

  <blockquote class="note"><p><strong class="note">注意</strong>: 
   <span class="simpara">
    libpng と共に PHP をコンパイルする際、GD
    ライブラリとリンクされる同じバージョンを使用する必要があります。
   </span>
  </p></blockquote>
 </p>
 <p class="para">
  GDがより多くのフォントを扱えるようにするには
  <code class="literal">--with-XXXX</code>のような形のオプションを指定します。
  <table class="doctable table">
   <caption><strong>サポートされるフォントライブラリ</strong></caption>
   
    <thead>
     <tr>
      <th>フォントライブラリ</th>
      <th>configure オプション</th>
     </tr>

    </thead>

    <tbody class="tbody">
     <tr>
      <td><code class="literal">FreeType 2</code></td>
      <td>
       FreeType 2 をサポートするには
       <strong class="option configure">--with-freetype-dir=DIR</strong>を指定します。
       PHP 7.4.0 以降では、<span class="productname">pkg-config</span>
       に依存しているので、 <strong class="option configure">--with-freetype</strong> を代わりに使ってください。
      </td>
     </tr>

     <tr>
      <td><code class="literal">ネイティブ TrueType 文字列関数</code></td>
      <td>
       ネイティブな TrueType 文字列関数 をサポートするには
       <strong class="option configure">--enable-gd-native-ttf</strong>を指定します
       (これは PHP 7.2.0 で削除されました。)
      </td>
     </tr>

    </tbody>
   
  </table>

 </p>
</div><?php manual_footer($setup); ?>