当前位置: 首页 > article >正文

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


http://www.kler.cn/a/109131.html

相关文章:

  • mysql 快速解决死锁方式
  • js中import引入一个export值可以被修改。vue,react
  • 从0开始学docker (每日更新 24-11-7)
  • Sql server 备份还原方法
  • 速通LoRA:《LoRA: Low-Rank Adaptation of Large Language Models》全文解读
  • 类型转换指令及方法调用与返回指令
  • RabbitMQ如何保证消息不丢失呢?
  • 在 Windows 用 Chrome System Settings 设置代理
  • WebClient, HttpClient, OkHttp: 三个Java HTTP客户端的比较
  • 设计模式——策略模式(Strategy Pattern)+ Spring相关源码
  • Mysql8.1.0 windows 绿色版安装
  • L99SM81V
  • 画时钟(turtle库)
  • Postman的使用
  • javascript中各种风骚的代码
  • Redis快速上手篇七(集群-六台虚拟机)
  • 杂牌行车记录仪特殊AVI结构恢复案例
  • (一)MySQL-架构
  • 8.Scala面向对象编程
  • STM32H750之FreeRTOS学习--------(一)初识RTOS
  • Go 小知识之 Go 中如何使用 set
  • OPNET <<< Program Abort >>> Standard function stack imbalance
  • 自动化项目实战 [个人博客系统]
  • 论坛介绍 | COSCon'23 开源文化(GL)
  • 算法笔记【6】-简单选择排序算法
  • 关于使用ScriptObject作为项目数据配置