Link to home
Start Free TrialLog in
Avatar of Shalom Carmel
Shalom CarmelFlag for Israel

asked on

AWS CloudFormation: Need to install a new php version

I have a CloudFormation template that sets up a server with Apache and PHP.
For an example, look at this simple template that installs php and httpd.
https://s3.amazonaws.com/cloudformation-templates-us-east-1/WordPress_Single_Instance.template

The setup is done in the "AWS::CloudFormation::Init" section via the following snippet
            "packages" : {
              "yum" : {
                "php"        : [],
		"httpd"        : []
		}
            },

Open in new window


The thing is that this method installs php 5.3.29, and I need at least 5.4.

According to documentation, the required version number can be included in the package description, so I tried this
"php"        : ["5.4"],

Open in new window

and this
"php"        : ["54"],

Open in new window

but nothing works. Specifying the version number causes php to not be installed at all, and ultimately to stack failure and rollback.

So how do I make CloudFormation install php 5.4?

I can modify the template to run an install command via the user-data, like this
yum -y install php54

Open in new window


But it is rather inelegant.
Avatar of Ray Paseur
Ray Paseur
Flag of United States of America image

Maybe try with a Composer require statement like this:
/* Other Composer Statements */
    "require": {
        "php": ">=5.4.0"
    },
/* Other Composer Statements */

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Shalom Carmel
Shalom Carmel
Flag of Israel image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Shalom Carmel

ASKER

Did not get any relevant solutions and solved the problem on my own