I am trying to deploy a php application on Elastic Beanstalk. Everything is working fine except from my calls to the mongo driver.
My attempt to install it followed these steps (unsuccessfully):
sudo yum install php-devel
(for phpize)sudo pecl install mongo
follow instructions to try command: sudo echo "extension=mongo.so" >> /etc/php.ini
with
failure. error message is:
-bash: /etc/php.ini: Permission denied
Am I going about this the right way?
You should not SSH into Elastic Beanstalk to install php-devel
and mongo
. Those settings will disappear when your EB environment scales in/out or server crash by accident.
Try to use Configuration File to customize your EB Environment.
/your_app/.ebextensions/01install_mongo_driver.config
.Type the following inside the configuration file 01install_mongo_driver.config
to install php mongodb driver.
commands:
install_mongo_driver_command:
command: pecl install mongo
Because PHP 5.4 on 64bit Amazon Linux 2013.09 AMI already contained php-devel
, so you won't install it manually.