Last active
October 27, 2023 12:16
-
-
Save wcomnisky/6d276a9894a5b2078b552cc492fa1abd to your computer and use it in GitHub Desktop.
Install PHP AMQp on MacOS
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
brew search librabbitmq | |
brew install rabbitmq-c | |
pecl install amqp | |
# set the path to librabbitmq install prefix [autodetect] : /usr/local/Cellar/rabbitmq-c/0.10.0 | |
# if it fails follow the following (reference: https://github.com/pdezwart/php-amqp/issues/355#issuecomment-563203121): | |
git clone https://github.com/pdezwart/php-amqp.git github-pdezwart-php-amqp/ | |
cd github-pdezwart-php-amqp | |
#git checkout tags/v1.9.4 ./ | |
sudo phpize | |
./configure --with-librabbitmq-dir=/usr/local/Cellar/rabbitmq-c/0.10.0 | |
make && make install | |
# Then you just add extension=amqp to your php.ini, restart your php service | |
php -i|grep amqp |
Hey man, try pecl install amqp-1.11.0beta
I think this issue is related to: php-amqp/php-amqp#386
With amqp not having php 8 support
Hey man, try
pecl install amqp-1.11.0beta
I think this issue is related to: php-amqp/php-amqp#386
With amqp not having php 8 support
Huge shoutout to you, works well on MacOS with PHP 8 :)
Thanks, @GuiEloiSantos your solution worked for me!
Thank you very much, it really help :)
Update to the answer. amqp 1.11.0 is stable as of 2021/12. Also brew now installs 0.11.0
. So the script is outdated.
pecl install amqp
works fine on my env (macos, arm, php 8.1).
Has to specify /opt/homebrew/Cellar/rabbitmq-c/0.11.0
during the installation. Autodetect didn't work :
Set the path to librabbitmq install prefix [autodetect] :
building in /private/tmp/pear/temp/pear-build-bahadir.birsozEbcVbL/amqp-1.11.0
// ...
ERROR: `/private/tmp/pear/temp/amqp/configure --with-php-config=/opt/homebrew/opt/php/bin/php-config --with-librabbitmq-dir' failed
Set the path to librabbitmq install prefix [autodetect] : /opt/homebrew/Cellar/rabbitmq-c/0.11.0
building in /private/tmp/pear/temp/pear-build-bahadir.birsozGWZ225/amqp-1.11.0
running: /private/tmp/pear/temp/amqp/configure --with-php-config=/opt/homebrew/opt/php/bin/php-config --with-librabbitmq-dir=/opt/homebrew/Cellar/rabbitmq-c/0.11.0
// ...
Build process completed successfully
Installing '/opt/homebrew/Cellar/php/8.1.5/pecl/20210902/amqp.so'
install ok: channel://pecl.php.net/amqp-1.11.0
Extension amqp enabled in php.ini
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Unfortunately, I am getting an error when doing make && make install (php 8.0.3):
(also tried checking out to tags/v1.9.4, result is the same).