前提:安裝好php7,位置:/usr/local/phpphp
方法一:git
/usr/local/php7/bin/pecl install mongodbgithub
service php-fpm restartredis
方法二:mongodb
wget http://pecl.php.net/get/mongodb-1.5.0.tgzphp7
tar fxvz mongodb-1.5.0.tgzphp-fpm
cd mongo-1.5.0.net
/usr/local/php/bin/phpizerest
./configure --with-php-config=/usr/local/php/bin/php-configrabbitmq
make && make install
echo 'extension=mongodb.so' >> /usr/local/php/etc/php.ini
service php-fpm restart
方法一:
/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
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