I have installed the PHP Cookbook from opscode and the chef-dotdeb cookbook found at chef-dotdeb so that I can run PHP 5.4 in the vagrant box.
I would like to modify some of the default php.ini
settings.
According to the documentation for the chef php cookbook I can modify the settings using
node['php']['directives'] = {}
for example:
node['php']['directives'] = { :short_open_tag => 'Off' }
I have made the modification in the webserver.rb
script I have created in my applications cookbook.
When I provision or reload the vagrant box the php.ini
settings remain unchanged.
Any ideas what is wrong?
The contents of the webserver.rb file are:
include_recipe "nginx"
include_recipe "php"
node.default["php"]["directives"] = { :short_open_tag => 'Off' }
Even when i remove the dotdeb cookbook so that the only php stuff comes from the official opscode php cookbook it still doesnt update any ini values.
ADDITIONAL INFO
I have looked at the code in the opscode php cookbook that actually injects the directives into it erb php.ini template: https://github.com/opscode-cookbooks/php/blob/master/templates/ubuntu/php.ini.erb
The code that injects the appends the directives to the end of the file is:
<% @directives.sort_by { |key, val| key }.each do |directive, value| -%>
<%= "#{directive}=\"#{value}\"" %>
<% end -%>
this is always empty {}
However.... if i modify it to...
<% node.default[:php][:directives].sort_by { |key, val| key }.each do |directive, value| -%>
<%= "#{directive}=\"#{value}\"" %>
<% end -%>
Then the directives ARE injected into the template. Im not a ruby expert. What is the fundamental difference between these 2 pieces of logic???
vagrant destroy
and avagrant up
explicitly? – Polydactyloverride_attributes('php'=> { 'conf_dir'=>'/etc/php5/apache2' } )
and it updates the apache configuration instead of the cli... not the cleanest solution but if you only need your webserver config updated that's the simplest way to go. – Naominaor