宝塔安装mongodb插件失败的解决办法

安装时始终不成功。

进入控制台进行安装

/www/server/php/71# pecl install mongodb

WARNING: channel "pecl.php.net" has updated its protocols, use "pecl channel-update pecl.php.net" to update

pecl/mongodb requires PHP (version >= 7.2.0, version <= 8.99.99), installed version is 7.1.33

No valid packages found

install failed

安装72版本再安装

/www/server/php/72# pecl install mongodb

WARNING: channel "pecl.php.net" has updated its protocols, use "pecl channel-update pecl.php.net" to update

Warning: popen() has been disabled for security reasons in OS/Guess.php on line 254

PHP Warning: popen() has been disabled for security reasons in /www/server/php/72/lib/php/OS/Guess.php on line 254

Warning: popen() has been disabled for security reasons in /www/server/php/72/lib/php/OS/Guess.php on line 254

Warning: fgets() expects parameter 1 to be resource, null given in OS/Guess.php on line 255

PHP Warning: fgets() expects parameter 1 to be resource, null given in /www/server/php/72/lib/php/OS/Guess.php on line 255

Warning: fgets() expects parameter 1 to be resource, null given in /www/server/php/72/lib/php/OS/Guess.php on line 255

Warning: pclose() expects parameter 1 to be resource, null given in OS/Guess.php on line 264

PHP Warning: pclose() expects parameter 1 to be resource, null given in /www/server/php/72/lib/php/OS/Guess.php on line 264

Warning: pclose() expects parameter 1 to be resource, null given in /www/server/php/72/lib/php/OS/Guess.php on line 264

downloading mongodb-1.16.2.tgz ...

Starting to download mongodb-1.16.2.tgz (1,907,341 bytes)

........................................................................................................................................................................................................................................................................................................................................................................................done: 1,907,341 bytes

831 source files, building

Warning: putenv() has been disabled for security reasons in PEAR/Builder.php on line 367

PHP Warning: putenv() has been disabled for security reasons in /www/server/php/72/lib/php/PEAR/Builder.php on line 367

Warning: putenv() has been disabled for security reasons in /www/server/php/72/lib/php/PEAR/Builder.php on line 367

running: phpize

Warning: popen() has been disabled for security reasons in PEAR/Builder.php on line 525

PHP Warning: popen() has been disabled for security reasons in /www/server/php/72/lib/php/PEAR/Builder.php on line 525

Warning: popen() has been disabled for security reasons in /www/server/php/72/lib/php/PEAR/Builder.php on line 525

ERROR: failed to run `phpize'

我找到了解决方案:它对我有用。

百度一下,说是在php.ini里将popen函数禁用了

于是到宝塔界面修改取消禁止popen函数。

checking target system type... x86_64-pc-linux-gnu

configure: error: Cannot find php-config. Please use --with-php-config=PATH

ERROR: `/tmp/pear/temp/mongodb/configure' failed

依然报错

执行以下命令ubuntu系统下的,以为centos不行,换成了ubuntu系统

apt-get install php-pear php-dev libssl-dev pkg-config

再执行命令

pecl install mongodb

成功

Build process completed successfully

Installing '/usr/lib/php/20170718/mongodb.so'

install ok: channel://pecl.php.net/mongodb-1.16.2

Extension mongodb enabled in php.ini

配置php.ini

默认的不行,它加了引号,删除默认添加的改为以下命令,php最少到7.2

正确应该是

extension=/usr/lib/php/20170718/mongodb.so

相关推荐
程序研44 分钟前
mysql之group by语句
数据库·mysql
HaoHao_0102 小时前
AWS Outposts
大数据·服务器·数据库·aws·云服务器
HaoHao_0102 小时前
VMware 的 AWS
大数据·服务器·数据库·云计算·aws·云服务器
娶个名字趴2 小时前
Redis(5,jedis和spring)
数据库·redis·缓存
小光学长2 小时前
基于vue框架的的信用社业务管理系统设计与实现4gnx5(程序+源码+数据库+调试部署+开发环境)带论文文档1万字以上,文末可获取,系统界面在最后面。
数据库
鲁班班3 小时前
MySQL通过binlog恢复数据
数据库·mysql
Elastic 中国社区官方博客4 小时前
将 OneLake 数据索引到 Elasticsearch - 第二部分
大数据·数据库·elasticsearch·搜索引擎·信息可视化·全文检索
Joeysoda4 小时前
MySQL 基础学习(1):数据类型与操作数据库和数据表
数据库·mysql·oracle·database
烛.照1035 小时前
MySQL安装教程
数据库·mysql·adb
金融OG5 小时前
99.17 金融难点通俗解释:归母净利润
大数据·数据库·python·机器学习·金融