宝塔安装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

相关推荐
不羁。。1 小时前
【撸靶笔记】第七关:GET - Dump into outfile - String
数据库·笔记·oracle
yangchanghua1113 小时前
pgsql 如何查询今天范围内的数据(当天0点0分0秒 - 当天23点59分59秒....)
数据库·pgsql
larance3 小时前
SQLAlchemy 的异步操作来批量保存对象列表
数据库·python
python_chai3 小时前
从数据汇总到高级分析,SQL 查询进阶实战(下篇)—— 分组、子查询与窗口函数全攻略
数据库·sql·mysql
在努力的前端小白3 小时前
Spring Boot 敏感词过滤组件实现:基于DFA算法的高效敏感词检测与替换
java·数据库·spring boot·文本处理·敏感词过滤·dfa算法·组件开发
未来之窗软件服务3 小时前
自建知识库,向量数据库 (九)之 量化前奏分词服务——仙盟创梦IDE
数据库·仙盟创梦ide·东方仙盟·自建ai·ai分词
冒泡的肥皂6 小时前
MVCC初学demo(一
数据库·后端·mysql
.Shu.7 小时前
Redis Reactor 模型详解【基本架构、事件循环机制、结合源码详细追踪读写请求从客户端连接到命令执行的完整流程】
数据库·redis·架构
anghost1509 小时前
基于单片机的智能声控窗帘
单片机·嵌入式硬件·mongodb
薛晓刚10 小时前
当MySQL的int不够用了
数据库