zoukankan      html  css  js  c++  java
  • [php] PHP Fatal error: Class 'AMQPConnection' not found

    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!

  • 相关阅读:
    BZOJ3439: Kpm的MC密码
    BZOJ2819: Nim
    BZOJ1901: Zju2112 Dynamic Rankings
    Bzoj3230: 相似子串
    Bzoj4504: K个串
    CF609E. Minimum spanning tree for each edge
    bzoj1832: [AHOI2008]聚会
    css 笔记1
    namespace 相关
    cmd 命令
  • 原文地址:https://www.cnblogs.com/davidhhuan/p/3651924.html
Copyright © 2011-2022 走看看