When using rabbitmq,

$this->conn = new AMQPConnection($conn_args);
$this->conn->connect();

i got these errors

PHP Fatal error: Class 'AMQPConnection' not found

Here is the way to resolve it.

1. Install the librabbitmq library

  # Download the rabbitmq-c library @ version 0-9-1
git clone git://github.com/alanxz/rabbitmq-c.git
cd rabbitmq-c
# Enable and update the codegen git submodule
git submodule init
git submodule update
# Configure, compile and install
autoreconf -i
./configure --prefix=/var/share/software/rabbitmq-c
make && sudo make install

2. Install the amqp

wget http://pecl.php.net/get/amqp-1.2.0.tgz
tar zxvf amqp-1.2.0.tgz
cd amqp-1.2.0
phpize
./configure --with-php-config=/path/to/your/php-config --with-librabbitmq-dir=/var/share/software/rabbitmq-c
sudo make
sudo make install

Have fun with rabbitmq!

[php] PHP Fatal error: Class 'AMQPConnection' not found的更多相关文章

  1. 4.Android 打包时出现的Android Export aborted because fatal error were founds [closed]

    Android 程序开发完成后,如果要发布到互联网上供别人使用,就需要将自己的程序打包成Android 安装包文件(Android Package,APK),其扩展名为.apk.使用run as 也能 ...

  2. PHP严重致命错误处理:php Fatal error: Cannot redeclare class or function

    1.错误类型:PHP致命错误 Error type: PHP Fatal error Fatal error: Cannot redeclare (a) (previously declared in ...

  3. Slave I/O: Got fatal error 1236

    [起因] 一次zabbix报警,从库[Warning] MySQL-repl was down  # 不知道主库/storage空间小于20%时为什么没有触发trigger [从库错误日志] 1611 ...

  4. “fatal error C1010”错误解决的三种方法

    尝试写了一个简单的类文件,但在编译的时候提示错误,具体错误信息如下: fatal error C1010: unexpected end of file while looking for preco ...

  5. "Fatal error: Call to undefined function: file_put_contents()"

    打开页面时提示这个错误: Fatal error: Call to undefined function: file_put_contents() 意思是请求未定义的函数,出现这个提示通常有两种情况: ...

  6. fatal error

    1.   fatal error C1083: 无法打开源文件 编译报此错误:  1>c1xx : fatal error C1083: 无法打开源文件:“Projects\XXXCCCC\VB ...

  7. LINK : fatal error LNK1123: 转换到 COFF 期间失败: 文件无效或损坏

    同时安装了VS2012和VS2010,用VS2010 时 >LINK : fatal error LNK1123: 转换到 COFF 期间失败: 文件无效或损坏 问题说明:当安装VS2012之后 ...

  8. (转)win7 64 安装mysql-python:_mysql.c(42) : fatal error C1083: Cannot open include file: 'config-win.h': No such file or directory

    原文地址:http://www.cnblogs.com/fnng/p/4115607.html 作者:虫师 今天想在在win7 64位环境下使用python 操作mysql 在安装MySQL-pyth ...

  9. VS2010 ERROR:c1xx fatal error c1083

    在VS2010中新建文件夹,然后在文件夹内新建文件polling.cpp,可是在项目中不现实该cpp文件,所以就在在硬盘上将该文件删除,编译报错. >c1xx : fatal error C10 ...

随机推荐

  1. ”靠谱的C#“单例模式

    //静态构造函数的单例模式 public sealed class Singleton { private static readonly Singleton _instance = new Sing ...

  2. SpringMVC+MyBatis(最新)

    目前主流的Web MVC框架,除了Struts这个主力 外,还有Spring MVC,主要是由于Spring MVC配置比较简单,使用起来也十分明了,非常灵活,与Spring 集成较好,对RESTfu ...

  3. TestNG学习-002-annotaton 注解概述及其执行顺序

    此文主要讲述用 TestNG 基础的 annotation (注解)知识,及其执行的顺序,并通过一个 TestNG 简单的实例演示 annotation 的执行顺序. 希望能对初学 TestNG 测试 ...

  4. mysql日期加减

    mysql日期加减一.MySQL 为日期增加一个时间间隔:date_add().1.  示例:set @dt = now();select date_add(@dt, interval 1 day); ...

  5. ORACLE十进制与十六进制的转换

    十进制与十六进制的转换 十进制-->十六进制 select to_char(100,'XX') from dual; 十六进制-->十进制select to_number('7D','XX ...

  6. nginx端口被占用解决方案

    killall -9 nginx或service nginx restart(重新启动)

  7. Java基础——常用类(Date、File)以及包装类

    本文要点: 基本数据类型的包装类 字符串相关类: 不可变字符序列:String 可变字符序列:StringBuffer.StringBuilder 时间处理相关类: Date DateFormat.S ...

  8. linux内核编译相关

    参考:http://www.arm.linux.org.uk/docs/kerncomp.php 一. 内核编译1) linux 2.4make clean/make mrpropermake dep ...

  9. 转:VS中的路径宏 vc++中OutDir、ProjectDir、SolutionDir各种路径

    http://www.cnblogs.com/lidabo/archive/2012/05/29/2524170.html

  10. 主机OS重装的节点加回RAC集群步骤示例(11gR2 RAC)

    原文地址: https://blogs.oracle.com/Database4CN/entry/%E4%B8%BB%E6%9C%BAos%E9%87%8D%E8%A3%85%E7%9A%84%E8% ...