Discuz! Board

标题: php安装amqp模块扩展参考脚本 [打印本页]

作者: admin    时间: 2017-1-19 18:54
标题: php安装amqp模块扩展参考脚本
#/bin/bash
#
#2017.3.1 niechenxi
Bulidroot='/data/tools'
Libdir='/usr/local/rabbitmq-c-0.7.1'
Module='amqp'
Sourcecode='rabbitmq-c-0.7.1.tar.gz'

#安装rabbitmq-c
cd $Buildroot
wget https://codeload.github.com/alanxz/rabbitmq-c/tar.gz/v0.7.1 -O $Sourcecode
tar xf $Sourcecode
cd rabbitmq-c-0.7.1
autoreconf -i
./configure --prefix=$Libdir
make
make install

#安装amqp模块
which expect || yum -y install expect &> /dev/null
which pecl  &> /dev/null
if [ $? -ne 0 ]; then
  echo  "please install php first."
  exit 1
else
    expect -c "
     spawn pecl install $Module
         expect {
           \"install prefix\"
                {
                 send \"${Libdir}\r\"
                }
                }
         expect eof
    "
fi
echo "extension=amqp.so" >> /usr/local/php/etc/php.ini









欢迎光临 Discuz! Board (http://123.59.83.120:8080/) Powered by Discuz! X3.2