# cd /usr/src # wget http://jp2.php.net/get/php-5.6.14.tar.gz/from/this/mirror # tar xvzf php-5.6.14.tar.gz # cd php-5.6.14
# ./configure --enable-mbstring --with-pgsql=/usr/local/pgsql/ --with-apxs2=/usr/sbin/apxs --with-gd --with-jpeg-dir=/usr/lib/ --with-zlib --with-mysql --with-mysqli --with-pdo-mysql --with-freetype-dir=/usr/include/freetype2/ --enable-gd-native-ttf --enable-gd-jis-conv --enable-zip --with-libdir=/usr/lib64
しかし、色々足りないものがあってエラーになる。
足りないパッケージの追加とMakefileの作成を繰り返す
configure: error: xml2-config not found. Please check your libxml2 installation.
おすすめ記事
# yum install libxml2-devel ~ 略 ~ Installed: libxml2-devel.i386 0:2.6.26-2.1.25.el5_11 libxml2-devel.x86_64 0:2.6.26-2.1.25.el5_11 Dependency Installed: libxml2.i386 0:2.6.26-2.1.25.el5_11 Complete!
configure: error: jpeglib.h not found.
# yum install libjpeg-devel ~ 略 ~ Installed: libjpeg-devel.i386 0:6b-38 libjpeg-devel.x86_64 0:6b-38 Dependency Installed: libjpeg.i386 0:6b-38 Complete!
configure: error: png.h not found.
# yum install libpng-devel ~ 略 ~ Installed: libpng-devel.i386 2:1.2.10-17.el5_8 libpng-devel.x86_64 2:1.2.10-17.el5_8 Dependency Installed: libpng.i386 2:1.2.10-17.el5_8 Complete!
configure: error: freetype-config not found.
# yum install freetype-devel ~ 略 ~ Installed: freetype-devel.i386 0:2.2.1-32.el5_9.1 freetype-devel.x86_64 0:2.2.1-32.el5_9.1 Dependency Installed: freetype.i386 0:2.2.1-32.el5_9.1 Complete!
configure: error: Cannot find libpq-fe.h. Please specify correct PostgreSQL installation path
# yum install postgresql-devel ~ 略 ~ Installed: postgresql-devel.i386 0:8.1.23-10.el5_10 postgresql-devel.x86_64 0:8.1.23-10.el5_10 Dependency Installed: libtermcap.i386 0:2.0.8-46.1 postgresql.x86_64 0:8.1.23-10.el5_10 postgresql-libs.i386 0:8.1.23-10.el5_10 readline.i386 0:5.1-3.el5 Complete!
やっと、Makefileが作成された。
# make # make install
# php -v PHP 5.6.14 (cli) (built: Sep 30 2015 14:15:35) Copyright (c) 1997-2015 The PHP Group Zend Engine v2.6.0, Copyright (c) 1998-2015 Zend Technologies
インストール後、phpinfo()も確認できこれでOKかと思いWordPress(当ブログ)にアクセスすると「データベース接続確立エラー」のエラーで表示されない…。
phpMyAdminでログインしようとしても、「MySQLサーバにログインできません」のエラーでログインできない…。
しかし、MySQLにCUIでログインしてみると問題ありませんでした。
併せて、YUMの検索されない症状の対策を考えていて、知人に同じようにYUMで検索をしてもらいました。
すると、表示が明らかに違いしっかりと検索されていました。
そこで初めてYUMがおかしい…
と、結論付けました。