私はVagrantとChefの使用に比較的慣れていません。私は現在UbuntuLucid64を実行しており、デフォルトでPHP5.3.2をパッケージとしてインストールするOpscodePHPクックブックを使用しています。PHP 5.3.8または9を(ソースからまたはパッケージとして)インストールしたいのですが、正しく構成する方法がわからないようです。依存するクックブック(build-essential、xml、mysql)をコピーしました。これは私がこれまでに持っているものです:
# vagrant_main/recipes/default.rb
require_recipe "apt"
node.override["php"]["version"] = "5.3.9"
require_recipe "php::source"
しかし、エラーが発生します。スタックトレースの関連する行は次のとおりです。
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'
更新: PHPレシピにMySQLについて心配しないように指示すると、正常にインストールされるようです...
node.override["php"]["version"] = "5.3.9"
node.override["php"]["configure_options"]["mysql"] = false
require_recipe "php::source"
...しかし、Apacheは実行しているPHPのバージョンを認識していないようです。php_info()
はPHP5.3.2を使用していると報告していますが、コマンドライン(php -v
)は5.3.9を正しく報告しています。
私は何が間違っているのですか?