PHPをPHP7.3に上げたところ、Wordpressのアップデートで、下記のエラーが表示された。
Fatal error: Uncaught Error: Call to undefined function hash_algos() in /usr/xxxxxx/xxxxxx/wp-admin/includes/file.php:1166 Stack trace: #0
該当ファイルのエラーになったソースコードをみると下記のようになっていた。
if ( ! function_exists( 'sodium_crypto_sign_verify_detached' ) || ! in_\ array( 'sha384', array_map( 'strtolower', hash_algos() ) ) ) {
「hash_alogs()」でエラーになっているようだ。調べてみたら、php73-hash-7.3.X がインストールされていなかった。FreeBSDでパッケージから、php73-hashをインストールして、apacheを再起動した。
# pkg install php73-hash Updating FreeBSD repository catalogue... FreeBSD repository is up to date. All repositories are up to date. The following 1 package(s) will be affected (of 0 checked): New packages to be INSTALLED: php73-hash: 7.3.8 Number of packages to be installed: 1 152 KiB to be downloaded. Proceed with this action? [y/N]: y [1/1] Fetching php73-hash-7.3.8.txz: 100% 152 KiB 155.8kB/s 00:01 Checking integrity... done (0 conflicting) [1/1] Installing php73-hash-7.3.8... [1/1] Extracting php73-hash-7.3.8: 100% Message from php73-hash-7.3.8: This file has been added to automatically load the installed extension: /usr/local/etc/php/ext-20-hash.ini
すぐにWordpressのアップデートを試すと、「別の更新が進行中です。」と出てしまうことがある。これは、前のアップデートによるロックが発生しているため。15分経てば、DBのロックが解除されるので、時間が立ってから試す。