安装PHP MongoDB扩展时,报错
WARNING: channel "pecl.php.net" has updated its protocols, use "pecl channel-update pecl.php.net" to update
Could not download from "https://pecl.php.net/get/mongodb-1.5.5.tgz", cannot download "pecl/mongodb" (Connection to `ssl://pecl.php.net:443' failed: )
Error: cannot download "pecl/mongodb"
Download failed
install failed
解决办法
执行pecl channel-update pecl.php.net
然后又出现了
channel-add: temp_dir is not writable: "/tmp/pear/install" - You can change this location with "pear config-set temp_dir"
这句的意思是 /tmp/pear/install没有权限
修改权限
sudo chmod -R 777 /tmp/pear/install/
再执行 pecl channel-update pecl.php.net 安装扩展
如果还不行 就是要wget来 下载安装
wget https://pecl.php.net/get/mongodb-1.5.5.tgz