Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am running elastic beanstalk on AWs. using 64bit unix php 5.3.

I am wanting to install mongo driver so php will talk to mongo.

the usual command is:

sudo pecl install mongo

According to AWS support, the way to do it is via a .config file in .ebextensions. I cont seem to figure out the format that it needs to be in order to run a script to do it.

the script i am writing looks like this:

#!/bin/bash
sudo pecl install mongo

and the .config file I have looks like:

container_commands:
 command:
    command:        bash .ebextensions/mongo.sh

I must be doing it quite wrong because each time I try to deploy, it errors on trying to run the command.

The end result I want it to have mongo php extension installed using the .config method

Thanks for your help

share|improve this question

I accomplished this creating a config file with this content:

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

And it worked, but I am not sure if elasticbeanstalk is installing the extension every time I deploy a new version of my application.

Edit: now when you try to install the mongo extension through pecl it asks a question (Build with Cyrus SASL?). So you have to answer to the question automatically, that's why you have to use printf.

share|improve this answer
1  
yes it will try to, I got around that by writing a file to the server after successfully installing it, and then on each deployment it just checks if the file exists and if so, ignore the install command. – Charlie Smith Jul 11 '13 at 12:54

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.