apt-get install php5-dev
apt-get -y install libcurl3-openssl-dev
安装 PHP Mongodb Driver
1. 安装 Driver
echo "no" > answers.txt
pecl install mongo < answers.txt
rm answers.txt
2. 开启 PHP 扩展
echo 'extension=mongo.so' | sudo tee /etc/php5/mods-available/mongo.ini
sudo ln -s /etc/php5/mods-available/mongo.ini /etc/php5/fpm/conf.d/mongo.ini
sudo ln -s /etc/php5/mods-available/mongo.ini /etc/php5/cli/conf.d/mongo.ini
重启服务器
sudo service php5-fpm restart
网友评论