【问题标题】:Installing RabbitMQ PHP: Fatal error: Class 'AMQPConnection' not found安装 RabbitMQ PHP:致命错误:找不到类“AMQPConnection”
【发布时间】:2012-02-14 16:55:10
【问题描述】:

我已经在我的服务器上安装了 RabbitMQ,一切正常。我已经尝试使用 Java 客户端发送和接收排队的消息,一切都很完美。

现在我需要安装一个 PHP RabbitMQ 客户端,因为我想将 Java 程序与 PHP 网页通信,但这次我没有那么幸运。

我已经按照official webpage for this installation的步骤,具体是这些步骤:

# Download the rabbitmq-c library
hg clone http://hg.rabbitmq.com/rabbitmq-c/rev/3c549bb09c16 rabbitmq-c
cd rabbitmq-c
# Add the codegen requirement
hg clone http://hg.rabbitmq.com/rabbitmq-codegen/rev/f8b34141e6cb codegen
# Configure, compile and install
autoreconf -i && ./configure && make && sudo make install 

实际上在控制台上我可以看到它已“安装”,没有任何问题。但是当我尝试打开任何 AMQP 连接时,我会收到此错误:

Fatal error: Class 'AMQPConnection' not found

其实如果我使用 phpinfo();命令我看不到与 AMQP 模块相关的任何内容(例如在this 问题中)。所以我认为这可能是安装的问题,但我尝试重新安装了两次,它一直说一切顺利。

有人也遇到过这个问题吗?

【问题讨论】:

    标签: php rabbitmq amqp


    【解决方案1】:

    解决了..

    模块未加载到正确的 php.ini 文件中。刚刚在右侧 php.ini 文件末尾添加extension=amqp.so 并重新启动Apache。

    【讨论】:

    • 这取决于你的php安装、版本、网络服务器等
    猜你喜欢
    • 2012-01-02
    • 2017-12-28
    • 2015-03-20
    • 2022-01-02
    • 2013-09-27
    • 2013-08-16
    • 2016-08-21
    • 2014-05-08
    相关资源
    最近更新 更多