[PHP-users 10278] Re: GD2.0.1のインストールについて

Nobu php-users@php.gr.jp
Sat, 21 Sep 2002 14:06:12 +0900


はじめまして、ノブといいます。


> 浅井です
>
> 過去ログなどを参考にGD2.0.1、PHP4.2.2をインストールしてみま
> したが、GD2.0.1自体のコンパイルは成功しましたが、肝心のPHP
> のコンパイル時にエラーが発生し、インストールすることができ
> ません。解決策を教えていただけないでしょうか?
>
> 環境:apache1.3.26,PHP4.2.2,gd2.0.1,redhat6.2


私の環境は、TurboLinux 7 Serve + Apache1.3.26 + PHP4.2.3 ですが、
GD2.0.1 + FreeType2 で問題なく使えています。


> 7.PHP4.2.2インストール
> tar zxvf php-4.2.2.tar.gz
> cd php-4.2.2
> ./configure  \
> --with-pgsql  \
> --with-apxs=/usr/sbin/apxs \
> --enable-mbstring  \
> --enable-mbstr-enc-trans  \
> --enable-trans-sid \
> --enable-mbregex \
> --with-gd=/usr/local/src/gd-2.0.1 \
> --enable-gd-native-ttf \
> --with-freetype-dir=/usr/local/src/freetype-2.1.2 \
> --with-jpeg-dir=/usr/lib \
> --with-zlib=/usr/local \
> --with-png-dir=/usr/lib \
>
> 6まではエラーなくいきました、7の./configure後にmake
> をすると下記のエラーが発生します。
>
> make[2]: Entering directory `/usr/local/src/php-4.2.2/ext/gd'
> make[3]: Entering directory `/usr/local/src/php-4.2.2/ext/gd'
> /bin/sh /usr/local/src/php-4.2.2/libtool --silent --mode=compile
gcc  -I. -I/usr/local/src/php-4.2.2/ext/gd -I/usr/local/src/php-4.2.2/main -
I/usr/loc
>
al/src/php-4.2.2 -I/usr/include/apache -I/usr/local/src/php-4.2.2/Zend -I/us
r/local/include -I/usr/local/include/freetype2/freetype -I/usr/local/src/g
>
d-2.0.1/ -I/usr/local/src/php-4.2.2/ext/mysql/libmysql -I/usr/local/pgsql/in
clude -I/usr/local/src/php-4.2.2/ext/xml/expat  -DLINUX=22 -DUSE_HSREGEX -
> DUSE_EXPAT -I/usr/local/src/php-4.2.2/TSRM -g -O2 -prefer-pic  -c gd.c
> gd.c: In function `zm_startup_gd':
> gd.c:303: `gdArc' undeclared (first use in this function)
> gd.c:303: (Each undeclared identifier is reported only once
> gd.c:303: for each function it appears in.)
> gd.c:304: `gdPie' undeclared (first use in this function)
> gd.c:305: `gdChord' undeclared (first use in this function)
> gd.c:306: `gdNoFill' undeclared (first use in this function)
> gd.c:307: `gdEdged' undeclared (first use in this function)
> gd.c: In function `zif_imagecreatetruecolor':
> gd.c:588: warning: assignment makes pointer from integer without a cast
> gd.c: In function `zif_imagecolorat':
> gd.c:1626: structure has no member named `tpixels'
> make[3]: *** [gd.lo] Error 1
> make[3]: Leaving directory `/usr/local/src/php-4.2.2/ext/gd'
> make[2]: *** [all-recursive] Error 1
> make[2]: Leaving directory `/usr/local/src/php-4.2.2/ext/gd'
> make[1]: *** [all-recursive] Error 1
> make[1]: Leaving directory `/usr/local/src/php-4.2.2/ext'
> make: *** [all-recursive] Error 1

エラーの意味はよくわかりませんが(スイマセン…)、
PHP のコンパイル時に、

./configure
--with-gd=/usr
--with-freetype-dir=/usr
--with-zlib-dir=/usr
--with-png-dir=/usr
--with-jpeg-dir=/usr
(-- 他省略 --)

で、コンパイルは通りました。
過去ログでも紹介されていたと思いますが、
ライブラリが /usr/lib にインストールされている場合は、
PHP のコンパイル時に指定するパスは /usr で良かったと思います。
ちなみに、GD 以外は最初から入っていたものを使っています。

OS が Redhat ではないのでもしかしたら動作が異なるかもしれませんが、
ライブラリのインストールできているのなら、後はコンパイル時の問題かなとか思い
ました。

ご参考までに