首页 > 解决方案 > Linux Mint 17.3 Rosa 上的 PHP Mongodb 安装问题

问题描述

我是 mongodb 的新手,

我正在遵循一个教程并逐步进行,我安装了 mongodb 并从 shell 访问它。

然后我正在做 php mongodb 安装部分。我是通过 composer 完成的,安装 composer 并运行以下命令

composer require mongodb/mongodb

我在终端中得到以下错误输出。

$ composer require mongodb/mongodb
Using version ^1.4 for mongodb/mongodb
./composer.json has been created
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - mongodb/mongodb 1.4.2 requires ext-mongodb ^1.5.0 -> the requested PHP extension mongodb is missing from your system.
    - mongodb/mongodb 1.4.1 requires ext-mongodb ^1.5.0 -> the requested PHP extension mongodb is missing from your system.
    - mongodb/mongodb 1.4.0 requires ext-mongodb ^1.5.0 -> the requested PHP extension mongodb is missing from your system.
    - Installation request for mongodb/mongodb ^1.4 -> satisfiable by mongodb/mongodb[1.4.0, 1.4.1, 1.4.2].

  To enable extensions, verify that they are enabled in your .ini files:
    - /etc/php5/cli/php.ini
    - /etc/php5/cli/conf.d/05-opcache.ini
    - /etc/php5/cli/conf.d/10-pdo.ini
    - /etc/php5/cli/conf.d/20-json.ini
    - /etc/php5/cli/conf.d/20-mysql.ini
    - /etc/php5/cli/conf.d/20-mysqli.ini
    - /etc/php5/cli/conf.d/20-pdo_mysql.ini
  You can also run `php --ini` inside terminal to see which files are used by PHP in CLI mode.

Installation failed, deleting ./composer.json.

在这里,我将这些东西添加到我的 php.ini 文件中并重新启动了 apache 文件。

扩展 = mongodb.so

PHP 版本 - PHP 5.5.9 和 Linux Mint 17.3 Rosa

有什么建议吗?我在哪里做错了

标签: phpmongodbcomposer-phplinux-mint

解决方案


推荐阅读