PHPが7.4になったのでコンパイルしてみた
いやー、色々と変わりましたね。まずドハマりしたのが、mbstringオプションをつけているとコンパイルが通らない事。それらを解消すると、今度は PEAR が標準ではインストールされない事…本当に色々と変更があって対応が大変でした。ひとつずつやっつけていきたいと思います。OSはCentOS8.1です。
sqlite3 のエラー
configure: error: Package requirements (sqlite3 > 3.7.4) were not met:
まず、これ。sqlite3 を利用したいなら、devel の 3.7.4 以上を突っ込めというやつ。めんどくさいので以下で対応ました。shell は tcsh です。
dnf install https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm
dnf install https://rpms.remirepo.net/enterprise/remi-release-8.rpm
dnf install "libsqlite*"
oniguruma がインストールされない
次のエラーはmbstringでした。mbstringで利用している、oniguruma が PHP7.4からインストールされなくなりました。これは自前で入れないといけないので、dnfでインストールしようと思った所、oniguruma-devel が無いんです。(2020/03/27 現在)
仕方がないので、rpmで導入するようにました。
rpm -ivh https://rpms.remirepo.net/enterprise/8/remi/x86_64/oniguruma-6.8.2-0.1.el8.remi.x86_64.rpm
rpm -ivh https://rpms.remirepo.net/enterprise/8/remi/x86_64/oniguruma-devel-6.8.2-0.1.el8.remi.x86_64.rpm
PEARが無い
これでコンパイルは通るようになったので、PEARを導入しようとしたらコマンド自体が無くなっていました。これは今後廃止するようです。まぁcomposer全盛期の時代ですし、もはやPEARは時代遅れなんでしょうね。
ただ、現場では利用しなきゃいけないので対応しました。
--with-pear
このオプションで PEAR コマンドが導入されます。ただ非推奨なのでいつ使えなくなるか判りません。。
最終的なコンパイルオプション
./configure \
--with-libdir=lib64 \
--prefix=/usr/local/php \
--with-apxs2=/usr/local/apache/bin/apxs \
--with-curl \
--enable-zip \
--enable-calendar \
--enable-mbregex \
--enable-mbstring \
--enable-zend-signals \
--enable-gd-native-ttf \
--enable-exif \
--enable-soap \
--enable-sockets \
--enable-opcache \
--enable-xml \
--enable-dom \
--enable-apc \
--enable-apcu \
--with-config-file-path=/usr/local/php/lib/ \
--with-openssl \
--with-mysqli=mysqlnd \
--with-pdo-mysql=mysqlnd \
--with-xsl \
--with-libxml-dir=/usr/local \
--with-zlib-dir=/usr/local \
--with-zlib \
--with-imap \
--with-imap-ssl \
--with-kerberos \
--with-gettext \
--with-tidy \
--with-iconv \
--with-gd \
--with-pear \
--without-libzip \
--with-freetype-dir=/usr/local \
--with-png-dir=/usr/local \
--with-jpeg-dir=/usr/local
いくつかはそんなオプションもう無いよってエラーが出ますが、シカトしました(笑) 7.1とか7.2でも利用したいので、多少ダメでもいいんです。コンパイル通れば!(笑)