PHP5.0.2

用途と設置場所

イントラネットのデータベースサーバ兼PHPソースデバッグ用.

ビルド時のポリシー

コンパイル環境

  • OS
  • Webサーバ
    • Apache 2.0.51 (/usr/local 配下にソースから)
  • ライブラリ (全て /usr/local 配下にソースから)
    • GD: 2.0.28
      • libjpeg: 6b
      • libpng: 1.2.7
      • FreeType: 2.1.9
      • T1lib: 5.0.2
    • WU-IMAP: 2004a
    • OpenSSL: 0.9.7d
    • GNU MP: 4.1.4
    • GNU Iconv: 1.9.1
    • GNU gettext: 0.14.1
    • GNU readline: 5.0
    • zlib: 1.2.1
    • libxml: 2.6.13
    • libxslt: 1.1.10
    • Adobe FDF Toolkit: 6.0
    • GNU ncurses: 5.0
  • データベース等
  • その他
    • curl: 7.12.1
    • expat: 1.95.8
    • Sablot: 1.0.1

./configure オプション


./configure --host=i686-pc-linux-gnu --build=i686-pc-linux-gnu
--prefix=/usr/local --bindir=/usr/local/bin --sbindir=/usr/local/sbin
--sysconfdir=/etc --datadir=/usr/local/share --includedir=/usr/local/include
--libdir=/usr/local/lib --libexecdir=/usr/local/libexec --localstatedir=/var
--sharedstatedir=/usr/local/com --mandir=/usr/local/share/man
--infodir=/usr/local/share/info --cache-file=./config.cache
--with-config-file-path=/etc --with-config-file-scan-dir=/etc/php.d
--disable-debug --disable-rpath --enable-bcmath --enable-calendar
--enable-dio --enable-exif --enable-fast-install --enable-ftp
--disable-libgcc --enable-magic-quotes --enable-mbstring
--enable-memory-limit --enable-pcntl --enable-safe-mode
--enable-shared --enable-shmop --enable-sigchild --enable-soap
--enable-sockets --enable-static --enable-sqlite-utf8
--enable-sysvmsg --enable-sysvshm --enable-sysvsem
--enable-ucd-snmp-hack=no --enable-versioning --enable-wddx
--enable-yp --enable-zend-multibyte --with-apxs2=/usr/local/bin/apxs
--with-bz2=/usr/local --with-config-file-path=/etc
--with-config-file-scan-dir=/etc/php.d --with-curl=/usr/local
--with-db4=/usr/local --with-fdftk=/usr/local
--with-freetype-dir=/usr/local --enable-gd --with-gettext=/usr/local
--with-gmp=/usr/local --with-iconv=/usr/local --with-iconv-dir=/usr/local
--with-imap-ssl=/usr/local/ssl --with-imap=/usr/local
--with-jpeg-dir=/usr/local --with-kerberos=no --with-ldap=/usr/local
--with-libexpat-dir=/usr/local --with-libmbfl
--with-libxml-dir=/usr/local --with-mime-magic --with-ncurses=/usr/local
--with-openssl-dir=/usr/local/ssl --with-openssl=/usr/local/ssl
--with-pear --with-pgsql=/usr/local --with-png-dir=/usr/local
--with-readline=/usr/local --with-regex=php --with-snmp=no
--with-tiff-dir=/usr/local --with-tiff=/usr/local --with-unixODBC
--with-xpm-dir=/usr/X11R6/lib --with-xsl --with-zlib-dir=/usr/local
--with-zlib=/usr/local --enable-xslt --with-xslt-sablot=/usr/local
--enable-ctype --with-dom=/usr/local --with-dom-xslt=/usr/local
--enable-id3 --enable-mbstr-enc-trans --enable-mbregex
--enable-simplexml --enable-tokenizer --with-xmlrpc
--with-ttf=/usr/local --with-t1lib=/usr/local --with-gd

ソース改造内容(小手先の,しかも邪道)

ext/gd/gd.c で, 「FREETYPE_MAJOR, FREETYPE_MINOR がねぇぞ」と怒られたので

ext/gd/gd.c の頭の方に以下の内容追加


#ifndef FREETYPE_MAJOR
#define FREETYPE_MAJOR 2
#endif
#ifndef FREETYPE_MINOR
#define FREETYPE_MINOR 0
#endif

特記事項

  • ./configure オプション
    • --with-gd[=DIR] とあるが,実際に DIR の部分を記入して configure すると,gd-1.x を探してしまうようで,必ず途中で止まる.
      よって=DIR の部分を書かないのが正解.
    • この環境で --enable-libgcc とすると,bool値を定義している行でコケるので,disable-libgccは必須
    • ZZIPlibをインストールし,--with-zip オプションを付けても認識してくれない.PEAR でのインストールが必須か?
    • エラー無く./configure, make できたとしても,GDをはじめとする各種拡張モジュールが実際に適用されていないという変な状況が多々あったので,必ずどんな拡張ライブラリが適用されているかを phpinfo 関数,または php -i 等で確認すること.

参考: Apache の configure オプション

(イントラ用のサーバなので,何も考えていない)


./configure --prefix=/usr/local --enable-v4-mapped
--enable-exception-hook --enable-module=most --enable-shared=max
--enable-auth-anon --enable-mem-cache --enable-example
--enable-file-cache --enable-echo --enable-charset-lite
--enable-cache --enable-disk-cache --enable-isapi=no
--enable-case-filter --enable-case-filter-in
--enable-ext-filter --enable-log-forensic --enable-logio
--enable-mime-magic --enable-expires --enable-headers
--enable-usertrack --enable-unique-id --enable-ssl
--enable-optional-hook-support --enable-optional-hook-import
--enable-optional-fn-import --enable-optional-fn-export
--enable-static-support --enable-static-htpasswd --enable-so
--enable-http --enable-dav --enable-info --enable-suexec
--enable-cgi --enable-dav-fs --enable-rewrite
--with-ssl=/usr/local/ssl

参考2: PostgreSQL の configure オプション


./configure --prefix=/usr/local
--with-tcl --with-perl --with-python
--with-pam --with-openssl=/usr/local/ssl
--cache-file=./config.cache