title: Vagrant and Chef: How to install a newer version of PHP?
body: <p>I'm relatively new to using <a href="http://vagrantup.com" rel="noreferrer">Vagrant</a> and <a href="http://www.opscode.com/chef/" rel="noreferrer">Chef</a>. I'm currently running Ubuntu Lucid 64 and using the <a href="https://github.com/opscode/cookbooks/tree/master/php" rel="noreferrer">Opscode PHP cookbook</a> which installs PHP 5.3.2, as a package, by default. I'd like to install PHP 5.3.8 or 9 (either from source or as a package) but I can't seem to figure out how to configure it correctly. I have copied over the dependent cookbooks (build-essential, xml, mysql). This is what I have so far:</p>
  
  <pre><code># vagrant_main/recipes/default.rb
  
  require_recipe "apt"
  
  node.override["php"]["version"] = "5.3.9"
  require_recipe "php::source"
  </code></pre>
  
  <p>But I am getting an error. Here are the relevant lines of the stack trace:</p>
  
  <pre><code>NameError: wrong constant name DebianBeforeSqueeze?
  /opt/ruby/lib/ruby/gems/1.8/gems/chef-0.10.2/bin/../lib/chef/mixin/recipe_definition_dsl_core.rb:56:in `const_defined?'
  /opt/ruby/lib/ruby/gems/1.8/gems/chef-0.10.2/bin/../lib/chef/mixin/recipe_definition_dsl_core.rb:56:in `method_missing'
  /tmp/vagrant-chef-1/chef-solo-1/mysql/recipes/client.rb:26:in `from_file'
  /opt/ruby/lib/ruby/gems/1.8/gems/chef-0.10.2/bin/../lib/chef/cookbook_version.rb:578:in `load_recipe'
  /opt/ruby/lib/ruby/gems/1.8/gems/chef-0.10.2/bin/../lib/chef/mixin/language_include_recipe.rb:40:in `include_recipe'
  /opt/ruby/lib/ruby/gems/1.8/gems/chef-0.10.2/bin/../lib/chef/mixin/language_include_recipe.rb:27:in `each'
  /opt/ruby/lib/ruby/gems/1.8/gems/chef-0.10.2/bin/../lib/chef/mixin/language_include_recipe.rb:27:in `include_recipe'
  /tmp/vagrant-chef-1/chef-solo-1/php/recipes/source.rb:25:in `from_file'
  </code></pre>
  
  <p><strong>Update:</strong> If I tell the PHP recipe not to worry about MySQL, it seems to install fine...</p>
  
  <pre><code>node.override["php"]["version"] = "5.3.9"
  node.override["php"]["configure_options"]["mysql"] = false
  require_recipe "php::source"
  </code></pre>
  
  <p>...however, Apache doesn't seem to know which version of PHP it's running. <code>php_info()</code> is reporting that it's using PHP 5.3.2, but command line (<code>php -v</code>) is correctly reporting 5.3.9. </p>
  
  <p>What am I doing wrong?</p>