RabbitMQ 从入门到放弃系列笔记(二):Mac 下搭建 PHP 开发环境

1、安装 RabbitMQ:

brew install rabbitmq

2、接下来安装 rabbitmq-c,C 与 RabbitMQ 通信需要依赖这个库:

git clone git://github.com/alanxz/rabbitmq-c.git  
cd rabbitmq-c
mkdir build  && cd build  
cmake -DCMAKE_INSTALL_PREFIX=/usr/local ..  
cmake --build . --target install

注:这块安装过程中可能报错比较多,你可以把你遇到的奇葩问题贴出来,一起讨论。

3、安装对应的 PHP 扩展:

wget http://pecl.php.net/get/amqp-1.9.1.tgz
tar zvxf amqp-1.9.1.tgz
cd amqp-1.9.1
phpize
./configure --with-amqp
make && make install

4、最后将 extension=amqp.so 放到 php.ini,然后检测是否安装成功:

php -i | grep amqp

学院君 has written 848 articles

终身学习者,Laravel学院院长

4 thoughts on “RabbitMQ 从入门到放弃系列笔记(二):Mac 下搭建 PHP 开发环境

  1. Hao Dong says:

    cmake –build . –target install

    [ 32%] Building C object librabbitmq/CMakeFiles/rabbitmq.dir/amqp_openssl_bio.c.o
    [ 33%] Linking C shared library librabbitmq.dylib
    Undefined symbols for architecture x86_64:
    “_FIPS_mode_set”, referenced from:
    _amqp_uninitialize_ssl_library in amqp_openssl.c.o
    “_SSL_COMP_free_compression_methods”, referenced from:
    _amqp_uninitialize_ssl_library in amqp_openssl.c.o
    ld: symbol(s) not found for architecture x86_64
    clang: error: linker command failed with exit code 1 (use -v to see invocation)
    make[2]: *** [librabbitmq/librabbitmq.4.2.1.dylib] Error 1
    make[1]: *** [librabbitmq/CMakeFiles/rabbitmq.dir/all] Error 2
    make: *** [all] Error 2

  2. Miao says:

    Linking C shared library librabbitmq.dylib
    mac 安装的时候,执行到 sudo cmake –build . –target install 这步骤时出现了这个问题,貌似和 cmake 有关,请问怎么解决呢?

发表评论

标记为*的字段是必填项(邮箱地址不会被公开)

你可以使用这些HTML 标签和属性: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>