Closed Mulkave closed 9 years ago
Hi @Mulkave,
thanks for reaching out!
The php cookbook doesn't think you've got PHP installed already, which is why it tries to install it again.
I'd suggest you to set the php_recipe (see below) to your cookbook/recipe used to install PHP.
You can tweak the PHP recipe used in the Composer cookbook easily via (default['composer']['php_recipe'] = 'php::default'
).
Hope this helps - thanks in advance for your feedback!
Kind regards, David
@djoos thanks for the explanation! Will give it a try tonight and let you know.
Cheers,
@djoos unfortunately in my case this didn't work (by default) since php was installed as a system package without using a recipe, it's a feature in OpsWorks where you can specify packages to be installed on setup.
But! Your solution works by specifying a recipe that simply does nothing :smile: in my case and for whoever faces this in the future, this custom Chef JSON worked:
{
"composer": {
"php_recipe": "opsworks_ecs::deploy"
}
}
Thanks!
@Mulkave I had a similar scenario with php56 already installed, and your solution works perfectly, but my approach was to create my own no-operation recipe with nothing in it, and set node['composer']['php_recipe']
to mycookbook::noop
. This way, its a bit more verbose, plus negates any risk of opsworks_ecs::deploy
ever being updated TO do something (its currently "not implemented" but that could change!)
@cp5w :+1: thanks for sharing, indeed that's a better approach than my lazy one :smile:
Thanks guys, helped alot! A quick question; i've forked composer cookbook, changed the attribute: node['composer']['php_recipe'] to my cookbook and set the "depends" to my empty cookbook, this should work ?
Using it with AWS OpsWorks I have specified and installed php 5.5 on the machine already but when composer (this cookbook) requires php it tries to install an older version of php, error below:
Berksfile
Log