« Google OAuth 2.0 サーバーサイド設定 | メイン | .gitignore 備忘録 »

php

php 4.4.1 開発環境構築

 今更、php 4.4.1 開発環境が必要に。数々のお粗末を露呈してきた懲りないお役所は情報漏えいなど所詮 他人事。

 centos4.* はデフォルトで php 4.* がインストールされるものの、かろうじてcentos4.9 が入手可能。
 64ビットcentos4.9は、デフォルトで php4.3.9 がインストールされる。
 この64ビット版に php 4.4.1 をソースからコンパイルしようとすると、32ビット環境が前提らしく configure, make で多数パス修正・妥協必要。
 試行錯誤の結果、32ビットOSに php 4.4.1 をソースからコンパイルが楽。と言う訳でその手順...▼

●http://vault.centos.org/4.9/ から CentOS-4.8-i386 を入手、サーバー用途としてインストール。
●yum が使えないのでリポジトリを修正。
# wget http://vault.centos.org/4.9/CentOS-Base.repo
# mv CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo
●念のため更新。
# yum clean all
# yum install yum-fastestmirror
# yum update
●インストール直後
# php -v
PHP 4.3.9 (cgi) (built: Jun  1 2009 15:08:57)
Copyright (c) 1997-2004 The PHP Group
Zend Engine v1.3.0, Copyright (c) 1998-2004 Zend Technologies
# httpd -v
Server version: Apache/2.0.52
Server built:   Jun 29 2009 10:16:22
●webサーバ起動でブラウジング可能。
# apachectl restart
●php4.4.1のコンパイルに使用する為、/var/www/html/index.php
<?php
phpinfo();
?>
をブラウジングし、php4.3.9 の "Configure Command" を複製 。
●php4.4.1 ソースをダウンロード、展開、移動。
# wget http://museum.php.net/php4/php-4.4.1.tar.gz
# tar zxvf php-4.4.1.tar.gz
# cd php-4.4.1
●今回の configure,make で発生するエラーを解決するための追加インストール。
パッケージはエラーメッセージから yum search *** などで探索。
1. Perl is not installed
2. apxs was not found. Try to pass the path using --with-apxs2=/path/to/apxs
3. Apache was not built using --enable-so (the apxs usage page is displayed)
 ↓ Apacheに組み込むapxsはhttpd-develのパッケージをインストールすれば同時にインストールされる。
# yum install httpd-devel
configure: error: Please reinstall the libxslt >= 1.0.3 distribution
 ↓
# yum install libxslt-devel
configure: error: libjpeg.(a|so) not found.
 ↓
# yum install libjpeg-devel
configure: error: libpng.(a|so) not found.
 ↓
# yum install libpng-devel
configure: error: freetype2 not found!
 ↓
# yum install freetype-devel
configure: error: Cannot find rfc822.h. Please check your c-client installation.
 ↓
# yum install libc-client-devel
configure: error: Cannot find imap library (libc-client.a). Please check your c-client installation.
 ↓
# yum install libc-client
configure: error: Cannot find libpq-fe.h. Please specify correct PostgreSQL installation path
 ↓
# yum install postgresql-devel
configure: error: Cannot find pspell
 ↓
# yum install pspell-devel
configure: error: snmp.h not found. Check your SNMP installation.
 ↓
# yum install net-snmp-devel
/root/php-4.4.1/ext/odbc/php_odbc_includes.h:211: error: storage size of `lasterrormsg' isn't known
make: *** [ext/odbc/php_odbc.lo] エラー 1
 ↓ php-odbcではなく
# yum install unixODBC-devel
●Configure Command(デフォルトの php 4.3.9 と同じもの)
# ./configure \
--build=i686-redhat-linux-gnu \
--host=i686-redhat-linux-gnu \
--target=i386-redhat-linux-gnu \
--program-prefix= \
--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 \
--sharedstatedir=/usr/com \
--mandir=/usr/share/man \
--infodir=/usr/share/info \
--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=shared \
--enable-gd-native-ttf \
--without-gdbm \
--with-gettext \
--with-ncurses=shared \
--with-gmp \
--with-iconv \
--with-jpeg-dir=/usr \
--with-openssl \
--with-png \
--with-pspell \
--with-xml \
--with-expat-dir=/usr \
--with-dom=shared,/usr \
--with-dom-xslt=/usr \
--with-dom-exslt=/usr \
--with-xmlrpc=shared \
--with-pcre-regex=/usr \
--with-zlib \
--with-layout=GNU \
--enable-bcmath \
--enable-exif \
--enable-ftp \
--enable-magic-quotes \
--enable-sockets \
--enable-sysvsem \
--enable-sysvshm \
--enable-track-vars \
--enable-trans-sid \
--enable-yp \
--enable-wddx \
--with-pear=/usr/share/pear \
--with-imap=shared \
--with-imap-ssl \
--with-kerberos \
--with-ldap=shared \
--with-mysql=shared,/usr \
--with-pgsql=shared \
--with-snmp=shared,/usr \
--with-snmp=shared \
--enable-ucd-snmp-hack \
--with-unixODBC=shared,/usr \
--enable-memory-limit \
--enable-shmop \
--enable-calendar \
--enable-dbx \
--enable-dio \
--enable-mbstring=shared \
--enable-mbstr-enc-trans \
--enable-mbregex \
--with-mime-magic=/usr/share/file/magic.mime \
--enable-dbase \
--with-apxs2=/usr/sbin/apxs
●コンパイル
# make
●インストール
# make install
●結果
# php -v
PHP 4.4.1 (cli) (built: May 29 2016 07:25:58)
Copyright (c) 1997-2004 The PHP Group
Zend Engine v1.3.0, Copyright (c) 1998-2004 Zend Technologies

トラックバック

このエントリーのトラックバックURL:
https://www.remix.asia/cgi/mt/mt-tb.cgi/7526

コメントを投稿

(いままで、ここでコメントしたことがないときは、コメントを表示する前にこのブログのオーナーの承認が必要になることがあります。承認されるまではコメントは表示されません。そのときはしばらく待ってください。)