linux 下 php 安装 ZeroMQ 扩展
Posted 两脚任从行处来,一灵常与气相随。有时四大熏熏醉,借问青天我是
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了linux 下 php 安装 ZeroMQ 扩展相关的知识,希望对你有一定的参考价值。
一、下载安装源码包
ZeroMQ源码包下载地址:
http://zeromq.org/area:download
php的zmq扩展源码包
https://pecl.php.net/package/zmq
或如下地址:
https://github.com/mkoppanen/php-zmq
二、安装目录
ZeroMQ安装目录 /data/zeromq php安装目录 /data/nmp/php
三、安装ZeroMQ
> tar zxvf zeromq-4.1.4.tar.gz > cd zeromq-4.1.4 > ./autogen.sh > ./configure --prefix=/data/zeromq > make && make install > ldconfig
如果出现如下问题:
No package ‘libsodium‘ found
https://github.com/jedisct1/libsodium
> cd libsodium-master/ > ./autogen.sh > ./configure > make && make install > ldconfig > vi /root/.bashrc
#添加如下信息 export sodium_CFLAGS="-I/usr/local/include" export sodium_LIBS="-L/usr/local/lib" export CPATH=/usr/local/include export LIBRARY_PATH=/usr/local/lib export LD_LIBRARY_PATH=/usr/local/lib export LD_RUN_PATH=/usr/local/lib export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig export CFLAGS=$(pkg-config --cflags libsodium) export LDFLAGS=$(pkg-config --libs libsodium) > source ~/.bashrc > echo "/usr/local/lib" > tee -a /etc/ld.so.conf.d/libsodium.conf
如果出现如下问题:
libtool is required, but wasn‘t found on this system
http://ftp.gnu.org/gnu/libtool/
> tar zxvf libtool-2.4.6.tar.gz > cd libtool-2.4.6 > ./configure > make && make install
如果出现如下问题:
autoreconf: Entering directory `.‘ autoreconf: configure.ac: not using Gettext autoreconf: running: aclocal --force -I m4 configure.ac:1: error: Autoconf version 2.65 or higher is required configure.ac:1: the top level autom4te: /usr/bin/m4 failed with exit status: 63 aclocal: autom4te failed with exit status: 63 autoreconf: aclocal failed with exit status: 63
http://ftp.gnu.org/gnu/autoconf/
> tar zxvf autoconf-latest.tar.gz > cd autoconf-2.69 > ./configure > make && make install
如果出现如下问题:
configure.ac:682: error: possibly undefined macro: AC_LIBTOOL_WIN32_DLL If this token and others are legitimate, please use m4_pattern_allow. See the Autoconf documentation. autoreconf: /usr/local/bin/autoconf failed with exit status: 1
> yum -y install automake autoconf m4 libtool
四、安装php扩展
> tar zmq-1.1.3.tgz > cd zmq-1.1.3 > /data/nmp/php/bin/phpize > ./configure --with-php-config=/data/nmp/php/bin/php-config --with-zmq=/data/zeromq > make && make install
如果出现如下信息:
Installing shared extensions: /data/nmp/php/lib/php/extensions/no-debug-non-zts-20151012/
extension = zmq.so
以上是关于linux 下 php 安装 ZeroMQ 扩展的主要内容,如果未能解决你的问题,请参考以下文章
在 Windows 10 和 PHP7 上将 ZeroMQ PHP 扩展添加到 XAMPP