- 安装mongodb扩展
前提:安装好php7,位置:/usr/local/php
方法一:
/usr/local/php7/bin/pecl install mongodb
service php-fpm restart
方法二:
wget http://pecl.php.net/get/mongodb-1.5.0.tgz
tar fxvz mongodb-1.5.0.tgz
cd mongo-1.5.0
/usr/local/php/bin/phpize
./configure --with-php-config=/usr/local/php/bin/php-config
make && make install
echo 'extension=mongodb.so' >> /usr/local/php/etc/php.ini
service php-fpm restart
- 安装redis扩展
方法一:
/usr/local/php7/bin/pecl install redis
service php-fpm restart
方法二:
wget http://pecl.php.net/get/redis-3.1.2.tgz
tar -xvf redis-3.1.2.tgz
cd redis-3.1.2
/usr/local/php/bin/phpize
./configure --with-php-config=/usr/local/php/bin/php-config
make
make install
service php-fpm restart
- Mq扩展安装
wget -c https://github.com/alanxz/rabbitmq-c/releases/download/v0.8.0/rabbitmq-c-0.8.0.tar.gz
cd rabbitmq-c-0.8.0
./configure --prefix=/usr/local/rabbitmq-c-0.8.0
make && make install
wget wget https://pecl.php.net/get/amqp-1.9.3.tgz
tar -xvf amqp-1.9.3.tgz
cd amqp-1.9.3
/usr/local/php/bin/phpize
./configure --with-php-config=/usr/local/php/bin/php-config --with-amqp --with-librabbitmq-dir=/usr/local/rabbitmq-c-0.8.0
make && make install
echo 'extension=amqp.so' >> /usr/local/php/etc/php.ini
service php-fpm restart