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. JDK的安装!力求简单明了!

    作为一个java语言的开发人员,第一件事就是安装JDK,就像当兵的要有刀枪,学生要有书本纸笔一样!话不多说,配置如下: 1.下载一个JDK安装包,解压到任意目录,我解压的是:C:\Tools\Java ...

  2. SQLServer temporary table and table variable

    Temporary tables are created in tempdb.  The name "temporary" is slightly misleading, for ...

  3. C语言命名空间

    //首先要认识到命名空间的使用条件.#include <stdio.h> typedef struct A { int A; } A; typedef union B { int A; } ...

  4. web storage: sessionStorage 和 localStorage

    // sessionStorage.setItem("message",str);function saveStorage(id){ var target = document.g ...

  5. linux 安装apahce的configure: error: APR not found. Please read the documentation解决办法

    1.下载所需软件包: 下载apr并配置 wget http://apache.freelamp.com/apr/apr-1.4.2.tar.gz 下载apr ./configure –prefix=/ ...

  6. 有用C函数集锦

    1. offsetof #include <stddef.h> size_t offsetof(type, member); The macro offsetof() returns th ...

  7. windows 64位 dll文件 位置及python包rtree shapely安装

    位置 \Windows\System32 python包依赖包安装 rtree 依赖 spatialindex(spatialindex.dll   spatialindex_c.dll) shape ...

  8. hbase基本操作

    public class Demo { private Configuration conf; private Connection conn; @Before public void prepare ...

  9. cocos2dx 3.x(捕鱼达人炮台角度换算)

    // // GameScence.hpp // NotesDamo // // Created by apple on 16/10/23. // // #ifndef GameScence_hpp # ...

  10. lua metatable 和 _index 实验

    lua metatable 和 _index 中文博客解释: http://www.cnblogs.com/simonw/archive/2007/01/17/622032.html metatabl ...