MacのPHP8で「dyld: Library not loaded: /usr/local/opt/tidy-html5/lib/libtidy.5.dylib」がでる

Mac
PHP
phpenv

MacのPHPをphpenvを使ってPHP8にアップグレードしたら、

dyld: Library not loaded: /usr/local/opt/tidy-html5/lib/libtidy.5.dylib
  Referenced from: /Users/username/.anyenv/envs/phpenv/versions/8.0.7/bin/php
  Reason: image not found

というエラーが。

該当箇所を見てみる

$ ls /usr/local/opt/tidy-html5/lib/
libtidy.5.8.0.dylib

どうやらバージョンが変わって、名前が変わっているよう。

シンボリックリンクを作成

$ sudo ln -s /usr/local/opt/tidy-html5/lib/libtidy.5.8.0.dylib /usr/local/opt/tidy-html5/lib/libtidy.5.dylib

これでOK