Install PHP-5.2.9 on CentOS 5.3

Cent君でphpをインストールしたときのメモ
日付とバージョンが違うのは、以前書いた項目を修正したため(5.2+5.2.8を修正)
・Apache2のインストール
# yum -y install httpd
# yum -y install httpd-devel

・libmcrypt
# yum -y install libmcrypt
# yum -y install libmcrypt-devel

・OpenLDAP
openldap は httpd と一緒にインストされます。
# yum -y install openldap
# yum -y install openldap-devel
# yum -y install openldap-clients

・imap
# yum -y install libc-client
# yum -y install libc-client-devel
# yum -y install cyrus-sasl
# yum -y install cyrus-sasl-devel
# yum -y install cyrus-sasl-md5
# yum -y install cyrus-sasl-plain
# yum -y install cyrus-imapd
# yum -y install cyrus-imapd-devel
# yum -y install cyrus-imapd-utils

・Kerberos
PHPでimapを使用する場合 Kerberos が必要です。
libc-client は require Kerberos なので(たぶん install 済み)
# yum -y install krb5-libs
# yum -y install krb5-workstation
# yum -y install krb5-auth-dialog
# yum -y install krb5-deve

・FreeTDS(for MS-SQL)
# yum -y install freetds
# yum -y install freetds-devel

・その他のパッケージ
# rpm -q bison          無い場合は # yum -y install bison
# rpm -q flex           無い場合は # yum -y install flex
# rpm -qa | grep libXpm 無い場合は # yum -y install xorg-x11-devel

・その他、必要に応じて以下を確認して下さい。
gd-devel
zlib-devel
freetype-devel
libxml2-devel
libjpeg-devel
libpng-devel
openssl-devel
libxslt-devel

・Oracle instantclientのインストール
# unzip instantclient-basic-linux32-10.2.0.1-20050713.zip
# unzip instantclient-jdbc-linux32-10.2.0.1-20050713.zip
# unzip instantclient-sdk-linux32-10.2.0.1-20050713.zip
# unzip instantclient-sqlplus-linux32-10.2.0.1-20050713.zip
# mv instantclient_10_2 /usr/local

# cd /usr/local/instantclient_10_2
# ln -s libclntsh.so.10.1 libclntsh.so

適当な dir で以下を実行
# tar xvfz php-5.2.9.tar.gz
# ./configure 実行時の注意
changePerm.sh 適用済み : --with-oci8
詳細は以下を参照
http://otndnld.oracle.co.jp/tech/opensource/htdocs/php/inst_php_apache_linux/inst_php_apache_linux.html
# ./configure \
        --with-libdir=lib64                     \ # x_64 の場合追加
        --with-tsrm-pthreads                    \
        --enable-calendar                       \
        --with-apxs2=/usr/sbin/apxs             \
        --with-openssl                          \
        --with-kerberos                         \
        --with-zlib=/usr                        \
        --with-gd                               \
        --with-jpeg-dir                         \
        --with-png-dir                          \
        --with-libxml-dir=/usr                  \
        --with-xsl                              \
        --with-xpm-dir=/usr/X11R6/lib           \
        --with-xmlrpc                           \
        --with-freetype-dir=/usr                \
        --enable-gd-native-ttf                  \
        --enable-gd-jis-conv                    \
        --with-gettext                          \
        --enable-mbstring                       \
        --enable-mbregex                        \
        --with-mcrypt                           \
        --with-mssql                            \
        --with-mysql                            \
        --with-pdo-mysql                        \
        --with-pgsql=/usr/local/pgsql           \
        --with-pdo-pgsql=/usr/local/pgsql       \
        --with-unixODBC=/usr                    \
        --with-oci8=instantclient,/usr/local/instantclient_10_2  \
        --with-pdo-oci=instantclient,/usr/local/instantclient_10_2,10.2.0.1 \
        --enable-soap                           \
        --without-sqlite                        \
        --without-pdo-sqlite                    \
        --enable-ftp

#        --with-ldap-sasl                        \
#        --with-ldap                             \
#        --with-config-file-path=/usr/local/lib  \
#        --with-imap=/usr                        \
#        --with-imap-ssl                         \
#        --with-oci8                             \
#        --with-pdo-oci                          \
#        --with-libexpat-dir=/usr                \

# make
# make install

/etc/httpd/conf/httpd.conf の編集
・以下の行を修正
LoadModule php5_module        /usr/lib/httpd/modules/libphp5.so
LoadModule php5_module        modules/libphp5.so   // 好みですね
以下の行を修正
AddDefaultCharset off                       // 好みですね

# cp php.ini-dist /usr/local/lib/php.ini
/usr/local/lib/php.ini の編集               // 以下好みに応じて設定
allow_url_fopen = Off
default_charset = EUC-JP
register_globals = Off
log_errors = on
error_log = syslog
upload_tmp_dir = /var/tmp/apache/upload     // 好みに応じて設定
upload_max_filesize = 2M                    // 好みに応じて設定
session.save_path = /var/tmp/apache/session // 好みに応じて設定
output_handler = mb_output_handler

以下はXCVI. マルチバイト文字列関数 (mbstring)を参照
mbstring.language = Japanese
mbstring.internal_encoding = EUC-JP
mbstring.http_input = auto
mbstring.http_output = EUC-JP
mbstring.encoding_translation = On
mbstring.detect_order = auto

# service httpd restart

DocumentRoot に以下の内容でファイルを作成して内容を確認してください。
# cat phpinfo.php
<? phpinfo() ?>