宝塔安装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 小时前
Java项目:基于SSM框架实现的忘忧小区物业管理系统【ssm+B/S架构+源码+数据库+毕业论文+开题报告】
java·数据库·mysql·vue·毕业设计·ssm框架·小区物业管理系统
ZWZhangYu7 小时前
LangChain 构建向量数据库和检索器
数据库·langchain·easyui
feifeigo1238 小时前
升级到MySQL 8.4,MySQL启动报错:io_setup() failed with EAGAIN
数据库·mysql·adb
火龙谷9 小时前
【nosql】有哪些非关系型数据库?
数据库·nosql
焱焱枫10 小时前
Oracle获取执行计划之10046 技术详解
数据库·oracle
qq_3923971212 小时前
Redis常用操作
数据库·redis·wpf
一只fish13 小时前
MySQL 8.0 OCP 1Z0-908 题目解析(17)
数据库·mysql
花好月圆春祺夏安14 小时前
基于odoo17的设计模式详解---装饰模式
数据库·python·设计模式
A__tao14 小时前
SQL 转 Java 实体类工具
java·数据库·sql
m0_6530313614 小时前
腾讯云认证考试报名 - TDSQL数据库交付运维专家(TCCE PostgreSQL版)
运维·数据库·腾讯云