WordPressのサイトヘルス画面で推奨モジュールが存在しないと怒られる

WordPressのサイトヘルス画面で推奨モジュールが存在しないと怒られました。

詳細は以下の通り。

1つ以上の推奨モジュールが存在しません
パフォーマンス
PHP モジュールはサイトの稼働に必要なほとんどのタスクをサーバー上で実行します。変更はサーバー管理者が実施する必要があります。

WordPress ホスティングチームでは、こうした推奨されていたり必須とされていたりするモジュールのリストをチームのハンドブック (新しいタブで開く)でメンテナンスしています。

警告 オプションのモジュール zip がインストールされていないか、無効化されています。
警告 オプションのモジュール intl がインストールされていないか、無効化されています。

 

PHPをソースからインストールしてるの構成コマンドのパラメータを確認したら、確かにzipとintlを有効化していなかった。

なので--with-zip、--enable-intlを追加して、再度configureを実行する。

./configure \
--prefix=/usr/local/ap/php \
--enable-fpm \
--with-config-file-path=/usr/local/ap/php/etc \
--enable-libgcc \
--with-openssl \
--with-zlib \
--with-zlib-dir=/usr \
--enable-gd \
--with-freetype \
--with-jpeg \
--with-xpm \
--with-webp \
--enable-bcmath \
--with-bz2 \
--enable-calendar \
--with-curl \
--enable-dba=shared \
--enable-exif \
--with-curl \
--enable-gd-jis-conv \
--with-gettext \
--enable-mbstring \
--with-mysqli=mysqlnd \
--with-pdo-mysql=mysqlnd \
--enable-pcntl \
--with-readline \
--enable-soap \
--enable-sockets \
--with-xsl \
--with-imap \
--with-imap-ssl \
--with-libdir=lib64 \
--with-kerberos \
--with-zip \
--enable-intl \
--enable-opcache \
--enable-shared

そうしたらicu絡みでライブラリが足りないと怒られる。

checking for icu-uc >= 50.1 icu-io icu-i18n... no
configure: error: Package requirements (icu-uc >= 50.1 icu-io icu-i18n) were not met:

Package 'icu-uc', required by 'virtual:world', not found
Package 'icu-io', required by 'virtual:world', not found
Package 'icu-i18n', required by 'virtual:world', not found

Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.

Alternatively, you may set the environment variables ICU_CFLAGS
and ICU_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.

なので、不足しているパッケージをインストールする。

dnf install libicu-devel

気を取り直して再度configureを再度実行すると無事終了したのでコンパイルする。

make all -j 3

コンパイルが無事終了したので、上書きインストールしてphp-fpmを再起動する。

make install

systemctl stop php-fpm
systemctl start php-fpm

 

再びWordPressのサイトヘルス画面に戻ると、「推奨モジュールが存在しない」エラーは消えました。

何かの参考になれば幸いです。

おすすめの記事