とりあえず、PHP7.2→7.3をphpbrewを使って入れることに。

必要な手順はこれ

7系のinstall状況を確認

$ brew search php@7  
==> Formulae  
php@7.2 ✔  php@7.3  php@7.4

入れる

$ phpbrew install 7.3.19 +default +mysql -- --with-zlib-dir=$(brew --prefix zlib)

以上だ!

以下自分の作業ログ


7系のinstall状況を確認

$ brew search php@7  
==> Formulae  
php@7.2 ✔  php@7.3  php@7.4

入れる

$ phpbrew install 7.3.19

Error

checking for the location of zlib... configure: error: zip support requires ZLIB. Use --with-zlib-dir=<DIR> to specify prefix where ZLIB include and library are located

Install 確認

$ brew install zlib

Warning

zlib 1.2.11 is already installed and up-to-date

To reinstall 1.2.11, run \`brew reinstall zlib\`

アップデート

$ brew reinstall zlib

パスを調べる

$ brew --prefix zlib  
/usr/local/opt/zlib

リベンジ

$ phpbrew install 7.3.19 +default -with-zlib-dir=/usr/local/opt/zlib

===> phpbrew will now build 7.3.19

The usage of multiple variants in one command line argument is deprecated.

Please provide them as individual arguments: -with -zlib -dir=/usr/local/opt/zlib

===> Loading and resolving variants...

Homebrew prefix "/usr/local/Cellar/curl/7.71.1" does not exist.

Exception: Variant "with" is not defined

エラーでうまくいかなかったのでさらにリベンジ

$ phpbrew install 7.3.19 -- --with-zlib-dir=$(brew --prefix zlib)

\* To configure your installed PHP further, you can edit the config file at

    /Users/{user_name}/.phpbrew/php/php-7.3.19/etc/php.ini

To use the newly built PHP, try the line(s) below:

    $ phpbrew use php-7.3.19

Or you can use switch command to switch your default php to php-7.3.19:

    $ phpbrew switch php-7.3.19

Enjoy!

これでアプリケーションを起動したけれど、mysqlのドライバがないってエラーが出たのでinstallをやり直した

特にuninstallとかせずに以下のコマンドでmysqlの問題も改善した

$ pwd; find . | sort | sed '1d;s/^\.//;s/\/\([^/]*\)$/|--\1/;s/\/[^/|]*/|  /g'