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:

sudo pecl install mongo

and the .config file I have looks like:

    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


I accomplished this creating a config file with this content:

    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.

  • 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

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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