php 安裝rabtmq amqp 擴展

php 安裝 rabbitmq-c-0.9.0 擴展php

  1. 安裝 ibrabbitmq-c
    github 倉庫地址
    https://github.com/alanxz/rab...git

    安裝過程若是報錯
    [ 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’未聲明(在此函數內第一次使用)github

    {"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.... 下載安裝 poptphp-fpm

    從新編譯ibrabbitmq-cui

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

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

2.pecl install amqprabbitmq

若是出現
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.inici

extension=amqp.so

4.php-fpm reload

相關文章
相關標籤/搜索