我想在我的mac sierra上使用pecl安装amqp
。
我使用brew安装了php,在运行pecl install amqp
时出现错误:checking for amqp using pkg-config... configure: error: librabbitmq not found
虽然我已经使用brew安装了librabbitmq-c
包,但仍然无法解决此问题。我认为这可能与pkg-config未同步有关。
有人知道如何处理吗?
首先使用brew安装rabbitmq-c:
brew search librabbitmq
No formula or cask found for "librabbitmq".
Closed pull requests:
Add rabbitmq-c (aka librabbitmq) formula (https://github.com/Homebrew/legacy-homebrew/pull/13437)
brew install rabbitmq-c
然后使用pecl安装amqp:
pecl install amqp
设置librabbitmq的路径:
Set the path to librabbitmq install prefix [autodetect] : /usr/local/Cellar/rabbitmq-c/0.9.0
验证amqp是否已安装:
php -i|grep amqp
/opt/homebrew/Cellar/rabbitmq-c/0.11.0
/usr/local/Cellar/rabbitmq-c/0.11.0
。 - Irini Koutaki我正在使用macOS High Sierra操作系统。我从developer.apple.com下载了Command_line_Tools_macOS_10.13_for_Xcode_10.1.dmg,并且通过brew安装了php 8。
为了安装amqp扩展,我执行了以下步骤:
brew install rabbitmq-c
pecl install amqp-1.11.0beta
在提示符处
设置librabbitmq安装前缀路径[自动检测]:
我输入:
设置librabbitmq安装前缀路径[自动检测]:/usr/local/Cellar/rabbitmq-c/0.11.0
mkdir -p /opt/homebrew/lib/php/pecl
。 - Max$ pkg-config librabbitmq --cflags
Package openssl was not found in the pkg-config search path.
Perhaps you should add the directory containing `openssl.pc'
to the PKG_CONFIG_PATH environment variable
Package 'openssl', required by 'librabbitmq', not found
export PKG_CONFIG_PATH="/usr/local/Cellar/rabbitmq-c/0.10.0/lib/pkgconfig:/usr/local/opt/openssl@1.1/lib/pkgconfig"
然后构建将成功。(注意:我是使用phpbrew而不是pecl构建的,但应该可以工作)。
在安装之前,请确保您的软件包管理器已经更新到最新版本:
brew update
接下来,使用以下命令安装RabbitMQ服务器:
brew install rabbitmq
如果该目录不在PATH中,建议将其添加:
export PATH=$PATH:/usr/local/sbin
export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:/usr/local/Cellar/rabbitmq-c/0.9.0/lib/pkgconfig"
这是一个问题和之前两个对我有用的答案的结合。
首先通过brew安装RabbitMQ作为rabbitmq-c。然后使用PECL,但在被要求时添加配置路径:/usr/local/Cellar/rabbitmq-c/0.10.0
需要根据您安装的RabbitMQ版本进行调整。
pecl config-set php_ini /usr/local/etc/php/7.2/php.ini
和brew install rabbitmq-c
以及pecl install amqp
仍然找不到amqp.so
文件。 - TDawg
php -i | grep amqp
没有返回任何确认 amqp 已启用的信息,但我仍然能够使用它。 - dmmd