PHP & GD のインストールする方法の質問です。./configure でGDが有効になりません。設定方法がまちがっていたらご指摘お願いします。


http://www.idiagdia.com/disca/files/2006-02-20-01.html

http://www.idiagdia.com/disca/files/2006-02-20-02.html

回答の条件
  • URL必須
  • 1人2回まで
  • 登録:
  • 終了:--
※ 有料アンケート・ポイント付き質問機能は2023年2月28日に終了しました。

回答4件)

id:bonlife No.1

回答回数421ベストアンサー獲得回数75

ポイント20pt

[■. PHP のインストール]の部分で ./configure の後に


--with-gd


がついていません。

そのためログにも


checking for GD support... no


と表示されています。


取り急ぎ、configureに --with-gd を追加してみてはいかがでしょうか。


その他の部分までは細かく目を通しておりませんので、別の部分でエラーが出る可能性もあります。

試す環境がないので、ご容赦ください。

id:disca

ありがとうございます。

私の思い込みかもしれませんが

「--with-gd-dir=/usr/local/lib」といったオプションを付けていましたため、「--with-gd」は不要と考えていました。早速試しています。たの方々のご回答をお待ちしています。

ちなみに phpinfo() の表示結果をUpload しましたので、ご参照頂けますと助かります。

http://www.idiagdia.com/disca/files/2006-02-20-03.html

--

http://jp.php.net/gd によれば、

>PHP 4.3以降、GD libの付属版が付属しています。

と掲載されていますが、PHP5以降の場合ですとGDをコンパイルする必要は無いのでしょうか?

2006/02/21 11:40:29
id:bonlife No.2

回答回数421ベストアンサー獲得回数75

ポイント20pt

http://www.teu.ac.jp/chiit/~yamamura/?cmd=read&page=%C6%FC%B...

有効なWikiNameではありません - T.Yama@千種研究室

重要な部分を見落としていました。

PHPのバージョンは5.12みたいですね。

その場合、GDを追加でインストールする必要はないはずです。

以下、先ほどの回答で挙げたURLにある説明です。


---

注意: PHP 4.3以降、GD libの付属版が付属しています。この付属版にはαブ レンディングのようないくつかの機能が追加されています。 この版のコードは、より管理が行き届き、安定しているため、 外部ライブラリの代わりに使用されるべきです。

---


デフォルトでは無効になっていたはずなので、有効に変更するだけで良いのではないでしょうか。

(configureに --with-gd を追記するだけで良いのではないでしょうか。)

一部の無効になっているオプションもあるようですが、それらは必要に応じて適宜追加すれば良いと思います。


URLはPHP5.05でGDを有効にした方の日記です。


ちなみに「--with-gd-dir」については存じておりませんでしたが、そのように変更したら上手く動いた、という例もあるようですね…。

ただ、オフィシャルなマニュアルには記述がありませんので、マニュアルとおりにインストールする方がベターだと思います。


参考になれば幸いです。

id:disca

ありがとうございます、現在 ./configure をしています。追ってご連絡します。

--

もし他になにか気づかれた方がいらっしゃいましたらご連絡して頂ければ幸いです。

2006/02/21 12:20:52
id:tezcello No.3

回答回数460ベストアンサー獲得回数69

ポイント10pt

うちのphp(Vine3.2/php5.0.3)では、例のソースを解凍してアップしただけで何事もなく動きます。

(preg_match_all , ImageCreate のエラーももちろんありません)

参考までに、phpinfo() の結果の Configure の部分のみ挙げます。


’./configure’ ’--prefix=/usr’ ’--exec-prefix=/usr’ ’--bindir=/usr/bin’ ’--sbindir=/usr/sbin’ ’--sysconfdir=/etc’ ’--datadir=/usr/share’ ’--includedir=/usr/include’ ’--libdir=/usr/lib’ ’--libexecdir=/usr/libexec’ ’--localstatedir=/var/lib’ ’--sharedstatedir=/usr/share’ ’--mandir=/usr/share/man’ ’--infodir=/usr/share/info’ ’--prefix=/usr’ ’--cache-file=../config.cache’ ’--with-config-file-path=/etc’ ’--with-config-file-scan-dir=/etc/php.d’ ’--enable-force-cgi-redirect’ ’--disable-debug’ ’--enable-pic’ ’--disable-rpath’ ’--enable-inline-optimization’ ’--with-bz2’ ’--with-db4=/usr’ ’--with-curl’ ’--with-exec-dir=/usr/bin’ ’--with-freetype-dir=/usr’ ’--with-png-dir=/usr’ ’--with-gd’ ’--enable-gd-native-ttf’ ’--with-gdbm’ ’--with-gettext’ ’--with-ncurses’ ’--with-gmp’ ’--with-iconv’ ’--with-jpeg-dir=/usr’ ’--with-openssl’ ’--with-png’ ’--with-regex=system’ ’--with-xml’ ’--with-expat-dir=/usr’ ’--with-xsl=/usr’ ’--with-xmlrpc=shared’ ’--with-pcre=/usr’ ’--with-zlib=/usr’ ’--with-layout=GNU’ ’--enable-bcmath’ ’--enable-exif’ ’--enable-ftp’ ’--enable-magic-quotes’ ’--enable-safe-mode’ ’--enable-sockets’ ’--enable-sysvsem’ ’--enable-sysvshm’ ’--enable-yp’ ’--enable-wddx’ ’--with-pear=/usr/share/pear’ ’--with-imap=shared’ ’--with-imap-ssl’ ’--with-ldap=shared’ ’--with-mysql=shared,/usr’ ’--enable-soap’ ’--enable-spl’ ’--with-pgsql=shared’ ’--with-snmp=shared,/usr’ ’--enable-ucd-snmp-hack’ ’--with-unixODBC=shared’ ’--enable-memory-limit’ ’--enable-shmop’ ’--enable-calendar’ ’--enable-dbx’ ’--enable-dio’ ’--enable-mcal’ ’--enable-mbstring’ ’--with-ttf’ ’--enable-discard-path’ ’--enable-xslt’ ’--with-xslt-sablot=/usr’ ’--enable-zend-multibyte’ ’--with-mcrypt=shared,/usr’ ’--with-apxs=/usr/sbin/apxs’

id:disca

QRコードのテストして頂きありがとうございます。当方の環境ですが、FreeBSD 5.4になります。

--bonlifeさんのの参考URLを試してみました。--

./configureは正常動作したのですが、make 時に下記のエラーが出力してしまいます。そのため、再度 --jpeg-lib-dir=/usr/local/lib を付けてコンパイルしたいと思います。

ext/gd/libgd/.libs/gd_jpeg.o(.text+0x24): In function `fatal_jpeg_error’:

/usr/home/dev/php-5.1.2/ext/gd/libgd/gd_jpeg.c:57: undefined reference to `jpeg_destroy’

ext/gd/libgd/.libs/gd_jpeg.o(.text+0xff): In function `php_gd_gdImageJpegCtx’:

/usr/home/dev/php-5.1.2/ext/gd/libgd/gd_jpeg.c:113: undefined reference to `jpeg_std_error’

ext/gd/libgd/.libs/gd_jpeg.o(.text+0x16c):/usr/home/dev/php-5.1.2/ext/gd/libgd/gd_jpeg.c:125: undefined reference to `jpeg_CreateCompress’

ext/gd/libgd/.libs/gd_jpeg.o(.text+0x19d):/usr/home/dev/php-5.1.2/ext/gd/libgd/gd_jpeg.c:131: undefined reference to `jpeg_set_defaults’

ext/gd/libgd/.libs/gd_jpeg.o(.text+0x1b3):/usr/home/dev/php-5.1.2/ext/gd/libgd/gd_jpeg.c:133: undefined reference to `jpeg_set_quality’

ext/gd/libgd/.libs/gd_jpeg.o(.text+0x228):/usr/home/dev/php-5.1.2/ext/gd/libgd/gd_jpeg.c:147: undefined reference to `jpeg_start_compress’

ext/gd/libgd/.libs/gd_jpeg.o(.text+0x284):/usr/home/dev/php-5.1.2/ext/gd/libgd/gd_jpeg.c:154: undefined reference to `jpeg_write_marker’

ext/gd/libgd/.libs/gd_jpeg.o(.text+0x30c):/usr/home/dev/php-5.1.2/ext/gd/libgd/gd_jpeg.c:171: undefined reference to `jpeg_write_scanlines’

ext/gd/libgd/.libs/gd_jpeg.o(.text+0x341):/usr/home/dev/php-5.1.2/ext/gd/libgd/gd_jpeg.c:205: undefined reference to `jpeg_finish_compress’

ext/gd/libgd/.libs/gd_jpeg.o(.text+0x349):/usr/home/dev/php-5.1.2/ext/gd/libgd/gd_jpeg.c:206: undefined reference to `jpeg_destroy_compress’

ext/gd/libgd/.libs/gd_jpeg.o(.text+0x3dd):/usr/home/dev/php-5.1.2/ext/gd/libgd/gd_jpeg.c:198: undefined reference to `jpeg_write_scanlines’

ext/gd/libgd/.libs/gd_jpeg.o(.text+0x411):/usr/home/dev/php-5.1.2/ext/gd/libgd/gd_jpeg.c:138: undefined reference to `jpeg_simple_progression’

ext/gd/libgd/.libs/gd_jpeg.o(.text+0x4da): In function `php_gd_jpeg_gdIOCtx_src’:

/usr/home/dev/php-5.1.2/ext/gd/libgd/gd_jpeg.c:640: undefined reference to `jpeg_resync_to_restart’

ext/gd/libgd/.libs/gd_jpeg.o(.text+0x57f): In function `php_gd_gdImageCreateFromJpegCtx’:

/usr/home/dev/php-5.1.2/ext/gd/libgd/gd_jpeg.c:256: undefined reference to `jpeg_std_error’

ext/gd/libgd/.libs/gd_jpeg.o(.text+0x5c4):/usr/home/dev/php-5.1.2/ext/gd/libgd/gd_jpeg.c:271: undefined reference to `jpeg_CreateDecompress’

ext/gd/libgd/.libs/gd_jpeg.o(.text+0x5e2):/usr/home/dev/php-5.1.2/ext/gd/libgd/gd_jpeg.c:276: undefined reference to `jpeg_save_markers’

ext/gd/libgd/.libs/gd_jpeg.o(.text+0x5ec):/usr/home/dev/php-5.1.2/ext/gd/libgd/gd_jpeg.c:278: undefined reference to `jpeg_read_header’

ext/gd/libgd/.libs/gd_jpeg.o(.text+0x670):/usr/home/dev/php-5.1.2/ext/gd/libgd/gd_jpeg.c:306: undefined reference to `jpeg_start_decompress’

ext/gd/libgd/.libs/gd_jpeg.o(.text+0x781):/usr/home/dev/php-5.1.2/ext/gd/libgd/gd_jpeg.c:386: undefined reference to `jpeg_finish_decompress’

ext/gd/libgd/.libs/gd_jpeg.o(.text+0x7b7):/usr/home/dev/php-5.1.2/ext/gd/libgd/gd_jpeg.c:401: undefined reference to `jpeg_destroy_decompress’

ext/gd/libgd/.libs/gd_jpeg.o(.text+0x871):/usr/home/dev/php-5.1.2/ext/gd/libgd/gd_jpeg.c:375: undefined reference to `jpeg_read_scanlines’

ext/gd/libgd/.libs/gd_jpeg.o(.text+0x931):/usr/home/dev/php-5.1.2/ext/gd/libgd/gd_jpeg.c:362: undefined reference to `jpeg_read_scanlines’

ext/gd/libgd/.libs/gd_jpeg.o(.text+0xa6d):/usr/home/dev/php-5.1.2/ext/gd/libgd/gd_jpeg.c:395: undefined reference to `jpeg_destroy_decompress’

*** Error code 1

Stop in /usr/home/dev/php-5.1.2.

もし、こういった不具合が出た方いらっしゃいましたらご連絡していただければ幸いに存じます。

2006/02/21 13:21:39
id:baihen No.4

回答回数104ベストアンサー獲得回数0

ポイント160pt

http://home.teachat.org/~graham/pagerank/dummy.html

ImageMagickのインストール on FreeBSD

3番の回答のコメントに書かれていますが

--jpeg-lib-dir=/usr/local/lib ではなくて

--with-jpeg-lib-dir=/usr/local/lib ではないでしょうか。

 ̄ ̄ ̄ ̄

またはそのパスが違うと思います。

id:disca

いつもご回答ありがとうございます。

早速試してみましたところ、./configure にて

--

checking for GD support... yes

checking for the location of libjpeg... no

If configure fails try --with-jpeg-dir=<DIR>

--が出力されました。

ちなみに…

ls /usr/local/lib/jpeglib*

では、

--

libjpeg.a

libjpeg.la

libjpeg.so

libjpeg.so.9

--

がありましたので、パスは問題ないと考えています。

--追記--2006/02/21 17:19

./configure にて --with-jpeg-dir=/usr/locla/lib を追加することで ./configure は問題なく突破できたようです。

checking for the location of libjpeg... /usr/local/lib

--追記--解決しました。

./configure にて gdのディレクトリを指定せず、 --with-gd --enable-module=so を付けることで解決しました。

回答していきました方々、まことにありがとうございました。

./configure --with-pgsql=/usr/local/pgsql --enable-trach-vars --enable-sockets --enable-mbstring --enable-mbstr-enc-trans --with-apxs=/usr/local/sbin/apxs --enable-trans-sid --with-config-file-scan-dir=/usr/local/etc/php --with-zlib-dir=/usr/local/lib --with-jpeg-lib-dir=/usr/local/lib --with-png-dir=/usr/local/lib --with-freetype-dir --with-gd

2006/02/21 18:03:40

コメントはまだありません

この質問への反応(ブックマークコメント)

トラックバック

「あの人に答えてほしい」「この質問はあの人が答えられそう」というときに、回答リクエストを送ってみてましょう。

これ以上回答リクエストを送信することはできません。制限について

回答リクエストを送信したユーザーはいません