本文介绍了连接时出现rabbitmq错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
当我尝试使用php-amqp连接时出现此错误:致命错误:找不到类'AMQPConnection'
i got this error when i try to connect using php-amqp:Fatal error: Class 'AMQPConnection' not found in
$credentials =array('host' => 'localhost','port' => 5672);
$cnn = new AMQPConnection($credentials);
$cnn->connect();
推荐答案
您似乎没有 AMQP PECL扩展已安装.该PECL扩展不是PHP的默认部分,因此您需要使用pecl
工具进行编译和安装.
It looks like you don't have the AMQP PECL extension installed. That PECL extension is not a default part of PHP, so you'll need to compile and install it using the pecl
tool.
这篇关于连接时出现rabbitmq错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!