Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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.

share|improve this question

2 Answers 2

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.

share|improve this answer

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

share|improve this answer

Your Answer

 
discard

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.