Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

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'm trying to get php 5.4 running on AWS Opsworks.

When I add the "PHP App Server" layer I get the following description "The PHP Application Server layer is a blueprint for instances that function as PHP application servers. By default PHP 5.3 and Apache 2.2 are installed."

I've tried to use "PHP App Sever" with some modifications. I've tried Custom Chef Recipes (from git:// mod_php54_apache2" and "deploy::php54"

After investigating the logs and the code I noticed that it's still installing 5.3 and failing when trying to install 5.4.

Another option I am considering is, choosing "custom layer" and either creating my own recipes, finding someone else's, or modifying one that's close enough. I noticed the AWS Chef recipe seems to have lots of hardcoded dependancy on PHP 5.3 so I'm not sure how much effort it would take to modify their code.

Ideally, it would be nice if AWS was on the verge of releasing options such as PHP 5.3 or 5.4 and/or Apache or Nginx but I haven't been able to find any information about how soon they'll be updating their recipes.

TL/DR: How to install PHP 5.4 on AWS Opsworks. Does someone have a Chef recipe that I can use, or pointers for modifying a Chef recipe that already exists.

share|improve this question

I've opened source the php 5.4 app layer I wrote. Note it only supports Amazon Linux AMI now.

It uses the PHP App layer by overriding some of opsworks recipes to install php 5.4 with mysql 5.5 support.

It also contains a phpapp cookbook which has a simpler way of deploying php apps from git repositories. Instead of cloning the entire repo every deployment, it will use git pull to pull only changes.

share|improve this answer

Regards. I take this recipe from GitHub here:

apt_repository "dotdeb-php54" do
  uri ""
  distribution "squeeze-php54"
  components ["all"]
  key ""

This recipe comes with the Dotdeb repositories who have PHP 5.4 included.

Using Vagrant (highly recommended) to deploy on AWS, you can do:


Tested in a EC2 instance

share|improve this answer

Your Answer


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.