php 安装 rabbitmq-c-0.9.0 扩展

  1. 安装 ibrabbitmq-c
    github 仓库地址
    https://github.com/alanxz/rab...

    安装过程如果报错
    [ 87%] Built target amqp-get  

    Scanning dependencies of target amqp-publish
    [ 88%] Building C object tools/CMakeFiles/amqp-publish.dir/publish.c.o
    /home/mpay/software/rabbitmq-c-master/tools/publish.c: 在函数‘main’中:
    /home/mpay/software/rabbitmq-c-master/tools/publish.c:87:23: 错误:‘POPT_ARG_ARGV’未声明(在此函数内第一次使用)

          {"header", 'H', POPT_ARG_ARGV, &headers, 0,  
                          ^  

    /home/mpay/software/rabbitmq-c-master/tools/publish.c:87:23: 附注:每个未声明的标识符在其出现的函数内只报告一次
    gmake[2]: * [tools/CMakeFiles/amqp-publish.dir/publish.c.o] 错误 1
    gmake[1]: * [tools/CMakeFiles/amqp-publish.dir/all] 错误 2
    gmake: * [all] 错误 2

    打开 http://freshmeat.sourceforge.... 下载安装 popt

    重新编译ibrabbitmq-c

    mkdir build && cd build
    cmake -DCMAKE_INSTALL_PREFIX=/usr/local/librabbitmq ..
    make && make install

    ln -s /usr/local/librabbitmq/lib64 /usr/local/librabbitmq/lib

2.pecl install amqp

如果出现
hecking for amqp using pkg-config... configure: error: librabbitmq not found
ERROR: `/tmp/pear/temp/amqp/configure --with-librabbitmq-dir' failed

在提示位置 输入   /usr/local/librabbitmq

3.配置php.ini

extension=amqp.so

4.php-fpm reload


missonce
96 声望5 粉丝

php 菜鸟