簡體   English   中英

嘗試在 Elastic Beanstalk Amazon Linux 中安裝 MongoDB PHP 驅動程序

[英]Trying to install MongoDB PHP Driver in Elastic Beanstalk Amazon Linux

嘗試在運行 Amazon Linux 的 Elastic Beanstalk 中安裝 MongoDB PHP 驅動程序。 已經在 .ebextensions 文件夾中創建了一個配置文件,代碼如下:

container_commands:
  01installMongoExtension:
    command: 'printf "\n" | pecl install -f mongo'
    ignoreErrors: true

得到以下錯誤:

Application deployment failed at 2018-11-06T20:01:32Z with exit status 2 and error: Hook /opt/elasticbeanstalk/hooks/appdeploy/pre/10_composer_install.sh failed.

具有以下內容:

Problem 1
- Installation request for alcaeus/mongo-php-adapter 1.1.3 -> satisfiable by alcaeus/mongo-php-adapter[1.1.3].
- alcaeus/mongo-php-adapter 1.1.3 requires ext-mongodb ^1.2.0 -> the requested PHP extension mongodb is missing from your system.
Problem 2
- Installation request for mongodb/mongodb 1.1.2 -> satisfiable by mongodb/mongodb[1.1.2].
- mongodb/mongodb 1.1.2 requires ext-mongodb ^1.2.0 -> the requested PHP extension mongodb is missing from your system.
Problem 3
- alcaeus/mongo-php-adapter 1.1.3 requires ext-mongodb ^1.2.0 -> the requested PHP extension mongodb is missing from your system.
- doctrine/mongodb 1.6.0 requires ext-mongo ^1.6.7 -> satisfiable by alcaeus/mongo-php-adapter[1.1.3].
- Installation request for doctrine/mongodb 1.6.0 -> satisfiable by doctrine/mongodb[1.6.0].

不知道從哪里開始,看到配置文件應該安裝驅動程序......

想補充一點,我看到 Jenkins 在/var/app/ondeck/目錄中構建應用程序的 repo 文件。

見這里: https : //codinglatte.com/posts/php/php-7-with-mongodb-to-elastic-beanstalk/

您需要使用pecl7而不是pecl

經過大量研究,我找到了適用於 php 7+ 的解決方案

commands:
 01installMongoExtension:
  command:  /usr/bin/yes 'no'| /usr/bin/pecl7 install mongodb
  test: '! /usr/bin/pecl7 info mongodb'

在 root 上創建 .ebextensions 文件夾。 在該文件夾中創建 php7-mongodb-driver.config 文件並將上面的代碼粘貼到其中。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM