4

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://github.com/evopix/opsworks-cookbooks.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.

2 Answers 2

3

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

https://github.com/aporat/opsworks-php54-app-layer-cookbooks

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.

0

Regards. I take this recipe from GitHub here:

apt_repository "dotdeb-php54" do
  uri "http://packages.dotdeb.org"
  distribution "squeeze-php54"
  components ["all"]
  key "http://www.dotdeb.org/dotdeb.gpg"
end

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

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

chef.add_recipe("dotdeb")
chef.add_recipe("dotdeb::php54")
chef.add_recipe("apache2")
chef.add_recipe("apache2::mod_php5")
chef.add_recipe("apache2::mod_rewrite")
chef.add_recipe("php")

Tested in a EC2 instance

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .