Macにphp-amqpをインストールする

BigSurなMacにPHP7.4の環境の構成に php-amqpを入れた見聞録です。
きっかけはsymfony/messengerコンポーネントでキューの処理にRabbitMQを使おうとしたらphp-amqpが必要だと言われたことでした。
librabbitmqを入れる
brewで入れます。
$ brew install rabbitmq-c
php-amqpを入れる
peclで入れました。
$ pecl install php-amqp
途中でSet the path to librabbitmq install prefix [autodetect] と librabbitmqのパスを求められますのでlibrabbitmqのパスを指定します。
私の環境では /opt/homebrew/opt/rabbitmq-c でした。
configure.ac:161: the top level
configure.ac:161: warning: back quotes and double quotes must not be escaped in: $as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe
build/libtool.m4:1184: AC_LIBTOOL_SYS_HARD_LINK_LOCKS is expanded from...
build/libtool.m4:2809: _LT_AC_LANG_CXX_CONFIG is expanded from...
build/libtool.m4:2808: AC_LIBTOOL_LANG_CXX_CONFIG is expanded from...
build/libtool.m4:1917: _LT_AC_TAGCONFIG is expanded from...
build/libtool.m4:70: AC_LIBTOOL_SETUP is expanded from...
build/libtool.m4:52: _AC_PROG_LIBTOOL is expanded from...
build/libtool.m4:39: AC_PROG_LIBTOOL is expanded from...
configure.ac:161: the top level
Set the path to librabbitmq install prefix [autodetect] : /opt/homebrew/opt/rabbitmq-c
これで少し待つとインストール完了します。
インストールできたか確認する
$ php -m
[PHP Modules]
amqp