zoukankan      html  css  js  c++  java
  • php rabbitmq的扩展

    1.下载:https://github.com/alanxz/rabbitmq-c/archive/v0.9.0.tar.gz

    mkdir build && cd build # 这一步是在rabbitmq-c的根目录下创建一个build子目录 
    cmake -DCMAKE_INSTALL_PREFIX=/usr/local/librabbitmq .. # 这一步是让cmake根据../CMakeList.txt,即rabbitmq-c的根目录下的CMakeList.txt创建Makefile文件,Makefile文件会被创建到build目录中
    cmake --build . # 这一步是真正的build rabbitmq-c库的,注意,不要漏掉结尾的点 '.'

    make

    make install

    错误:

    /usr/local/src/rabbitmq-c-0.9.0/tools/publish.c:87:23: note: each undeclared identifier is reported only once for each function it appears in
    gmake[2]: *** [tools/CMakeFiles/amqp-publish.dir/publish.c.o] Error 1
    gmake[1]: *** [tools/CMakeFiles/amqp-publish.dir/all] Error 2
    gmake: *** [all] Error 2

    解决:yum -y install popt popt-devel # 还是不成功
    http://freshmeat.sourceforge.net/projects/popt,源码安装 ok

    2.下载php 扩展

    http://pecl.php.net/get/amqp-1.9.0.tgz
    tar zvxf amqp-1.9.0.tgz #解压
    cd amqp-1.9.9 #打开目录
    /usr/bin/phpize
    ./configure --with-php-config=/usr/bin/php-config --with-amqp --with-librabbitmq-dir=/usr/local/librabbitmq
    
    make
    make install
    报错:
    /usr/bin/ld: cannot find -lrabbitmq collect2: error: ld returned 1 exit status make: *** [amqp.la] Error 1
    解决:yum install librabbitmq-devel
    php -i |grep php.ini

    extension=amqp.so #extension_dir自己定义
    service php-fpm restart #重启

    参考资料:https://www.cnblogs.com/spectrelb/p/6856246.html

    https://www.jianshu.com/p/65490900a937

  • 相关阅读:
    laravel中使用ElasticSearch详情
    linux 使用大全
    常见监控软件介绍及原理介绍
    DNS与域名解析
    linux基础入门(基础命令+vi+shell)
    php-fpm与fastcgi、php-cgi之间的关系及源码解析
    web系统整体性能测试
    typescript入门
    webpack
    React
  • 原文地址:https://www.cnblogs.com/myvic/p/10157043.html
Copyright © 2011-2022 走看看