I installed the PHP Cookbook from opscode and the chef-dotdeb cookbook found in chef-dotdeb so that I can run PHP 5.4 in a stray field.
I would like to change some default settings of php.ini .
According to the chef php cookbook documentation, I can change the settings using
node['php']['directives'] = {}
eg:
node['php']['directives'] = { :short_open_tag => 'Off' }
I made a modification to the webserver.rb script that I created in my application cookbook. When I install or restart the stray box, the php.ini settings remain unchanged.
Any ideas what is wrong?
The contents of the webserver.rb file:
include_recipe "nginx"
include_recipe "php"
node.default ["php"] ["directives"] = {: short_open_tag => 'Off'}
Even when I delete the dotdeb doll so that the only php material comes from the official php oppode cookie, it still does not update the ini values.
ADDITIONAL INFORMATION
I looked at the code in the opscode php cookie, which actually introduces the erb php.ini template directives into it: https://github.com/opscode-cookbooks/php/blob/master/templates/ubuntu/php.ini.erb
Code that adds directives to the end of the file:
<% @directives.sort_by { |key, val| key }.each do |directive, value| -%> <%= "#{directive}=\"#{value}\"" %> <% end -%>
it is always empty {}
However .... if I change it to ...
<% node.default[:php][:directives].sort_by { |key, val| key }.each do |directive, value| -%> <%= "#{directive}=\"#{value}\"" %> <% end -%>
Then the ARE directives are introduced into the template. I'm not a ruby ββspecialist. What is the fundamental difference between these two parts of logic?