テストサーバとして使用しているCentOS4.5のPHPは現在5.1系。
しかしDatetimeが使いたいという要請があったので、5.2にアップグレードすることにした。
調べるのが面倒なので(酷い)、パラメータは今入ってるphpinfoで確認した内容を流用。ほぼ全部有り。テストサーバだし、まあいいだろ。
マルチバイト系のパラメータが入ってなかったので追加。
# ./configure --program-prefix= \ --prefix=/usr \ --exec-prefix=/usr \ --with-pic \ --with-pear \ --with-bz2 \ --with-curl \ --with-png-dir=/usr \ --enable-gd-native-ttf \ --with-gettext \ --with-gmp \ --with-iconv \ --with-jpeg-dir=/usr/lib \ --with-openssl \ --with-zlib \ --enable-exif \ --enable-ftp \ --enable-magic-quotes \ --enable-sockets \ --with-kerberos \ --enable-calendar \ --with-mime-magic=/etc/httpd/conf/magic \ --with-sqlite \ --with-libxml-dir=/usr \ --with-apxs2=/usr/sbin/apxs \ --with-mysql \ --with-gd \ --enable-zend-multibyte \ --enable-mbstring \ --enable-mbregex ... checking for xml2-config path... configure: error: xml2-config not found. Please check your libxml2 installation.
なんか足りない。
# yum update libxml2.i386 ... Complete!
もう一回さっきのconfigureを実行。
# ./configure(以下略) ... checking for BZip2 in default path... not found configure: error: Please reinstall the BZip2 distribution
再インストール?
# rpm -q bzip2 # bzip2-1.0.2-13.EL4.3 # yum update bzip2* ... Complete! # rpm -q bzip2 bzip2-1.0.2-14.el4_7
リビジョンちょびっと上がった。
checking for BZip2 in default path... not found configure: error: Please reinstall the BZip2 distribution
ん?違う?
# yum install bzip2*
も、もっかい。
checking for cURL in default path... not found configure: error: Please reinstall the libcurl distribution - easy.h should be in <curl-dir>/include/curl/ # rpm -q curl-devel パッケージ curl-devel はインストールされていません
curl・・・使うかな・・・使わないかな・・・
# yum --enablerepo=rpmforge install curl-devel* ... Complete! # rpm -q curl-devel curl-devel-7.12.1-11.el4 # ./configure(以下略) ... configure: error: libjpeg.(a|so) not found.
GDは要るよな・・・
# find / -name libjpeg* /usr/lib/gthumb/modules/libjpegtran.so /usr/lib/gthumb/modules/libjpegtran.la /usr/lib/libjpeg.so.62 /usr/lib/libjpeg.so.62.0.0 /usr/share/doc/libjpeg-6b # cd /usr/lib # ln -s libjpeg.so.62.0.0 libjpeg.so
戻って再開。
# ./configure(以下略) ... configure: error: libpng.(a|so) not found.
お前もか。
# cd /usr/lib # ln -s libpng.so.2.1.0.16 libpng.so
これでいいだろ。
# ./configure(以下略) ... configure: error: png.h not found.
え?そういう問題じゃない?
# rpm -q libpng-devel パッケージ libpng-devel はインストールされていません # yum install libpng-devel # ./configure(略) ... configure: error: Unable to locate gmp.h
先生そろそろ心が折れそうです。
# yum install gmp-devel # ./configure(略) ... Thank you for using PHP.
通った・・・!
# make clean # make ... /root/php-5.2.9/ext/gd/libgd/gd_jpeg.c:38:21: jpeglib.h: No such file or directory (以下112行) /root/php-5.2.9/ext/gd/libgd/gd_jpeg.c:802: error: `outfile" undeclared (first use in this function) make: *** [ext/gd/libgd/gd_jpeg.lo] エラー 1
(゚д゚)・・・
# yum install libjpeg-devel # ./configure(略) ... Build complete. Don"t forget to run "make test".
(゚∀゚)!
# make clean # make # checkinstall Done. The new package has been saved to /usr/src/redhat/RPMS/i386/php-5.2.9-1.i386.rpm You can install it in your system anytime using: rpm -i php-5.2.9-1.i386.rpm
ktkr!
# rpm -i /usr/src/redhat/RPMS/i386/php-5.2.9-1.i386.rpm file /usr/bin/php from install of php-5.2.9-1 conflicts with file from package php-cli-5.1.6-3.el4s1.10 file /usr/lib/httpd/modules/libphp5.so from install of php-5.2.9-1 conflicts with file from package php-5.1.6-3.el4s1.10 file /etc/httpd/conf/httpd.conf from install of php-5.2.9-1 conflicts with file from package httpd-2.0.63-2.el4s1.centos.2
諦めてApacheからすっきり入れ直すことに。(最初からそうしろと)
次回に続く。