2

Our code base is using PHP 5.5 and we are wanting to deploy on AWS Opsworks however when selecting the PHP App Server layer we are told it has PHP 5.3.

What I was hoping is that I could just use the default PHP App Server layer and then specify php55 php55-cli and php-mcrypt as OS Packages - OS Packages

However I end up with the below log.

My actual goal is this;

  1. Install PHP 5.5, PHP 5.5-cli, PHP-Mcrypt
  2. chmod app/storage (recursively) to be writeable
  3. download composer.phar
  4. run composer install
  5. create the config files from a template using data from the layers custom json - mysql and redis settings.
  6. create the apache2 virtual host to point to the new Laravel app that has been deployed via git

So any help here would be appreciated.

[2014-04-07T04:37:58+00:00] INFO: execute[Clean up] ran successfully
[2014-04-07T04:37:58+00:00] INFO: Processing package[php-mcrypt] action upgrade (dependencies::default line 14)
[2014-04-07T04:37:58+00:00] INFO: Processing package[php55] action upgrade (dependencies::default line 14)
[2014-04-07T04:37:58+00:00] INFO: package[php55] installing php55-5.5.7-1.65.amzn1 from amzn-updates repository

================================================================================
Error executing action `upgrade` on resource 'package[php55]'
================================================================================


Chef::Exceptions::Exec
----------------------
returned 1, expected 0


Resource Declaration:
---------------------
# In /var/lib/aws/opsworks/cache/cookbooks/dependencies/recipes/default.rb

14:     package rpm do
15:       action :upgrade
16:       version(version)
17:     end
18:   end



Compiled Resource:
------------------
# Declared in /var/lib/aws/opsworks/cache/cookbooks/dependencies/recipes/default.rb:14:in `block in from_file'

package("php55") do
action [:upgrade]
retries 0
retry_delay 2
package_name "php55"
version "5.5.7-1.65.amzn1"
cookbook_name "dependencies"
recipe_name "default"
end
Hailwood
  • 49
  • 7

1 Answers1

1

In this case you have to use Custom Cookbooks.

During the instance creation your Custom Chef Cookbook is merged with the default AWS Chef Cookbook and you can take control of which operations are required to deploy your application.

You can also change the default AWS Chef recipes for the PHP App Server or create a Custom Layer and take control of almost everything.

Lucas Carvalho
  • 531
  • 4
  • 10