phpenvのエラーと戦う
CentOS6系、レガシーWordPress環境でPHPのバージョンを5.6.12→5.6.40に上げる作業をしたのでメモ。
今回はanyenv/phpenvを使った。
Readmeの通りにanyenv導入し、
anyenv install phpenv
でphpenv導入。
phpenvで
phpenv install 5.6.40
と5.6.40をインストールしようとしたところ、エラー連発したため対処法をメモしておく。
エラー1
configure: error: xml2-config not found. Please check your libxml2 installation.
yum install libxml2 yum install libxml2-devel libxslt-devel
エラー2
configure: error: Cannot find OpenSSL's <evp.h>
yum install openssl openssl-devel
エラー3
configure: error: Please reinstall the BZip2 distribution
yum install bzip2-devel
エラー4
configure: error: Please reinstall the libcurl distribution - easy.h should be in <curl-dir>/include/curl/
yum install libidn-devel curl-devel
エラー5
configure: error: jpeglib.h not found.
https://blog.77jp.net/php-528-%E3%82%A4%E3%83%B3%E3%82%B9%E3%83%88%E3%83%BC%E3%83%AB-linux
yum install libjpeg-devel
エラー6
configure: error: png.h not found.
yum install libpng-devel
エラー7
configure: error: Unable to detect ICU prefix or no failed. Please verify ICU install prefix and make sure icu-config works.
yum install libicu-devel
エラー8
configure: error: mcrypt.h not found. Please reinstall libmcrypt.
yum install libmcrypt-devel
エラー9
configure: error: Please reinstall readline - I cannot find readline.h
yum install readline-devel
エラー10
configure: error: Cannot find libtidy
yum install libtidy-devel
ここまでやるとコンパイルが成功した。 エラー連発と言っているが、最初の段階で必要なパッケージをまとめて入れておけばもっと早かっただろう。