簡體   English   中英

Vagrant和Chef:如何安裝更新版本的PHP?

[英]Vagrant and Chef: How to install a newer version of PHP?

我使用VagrantChef比較新。 我目前正在運行Ubuntu Lucid 64並使用默認情況下安裝PHP 5.3.2的Opscode PHP cookbook作為軟件包。 我想安裝PHP 5.3.8或9(從源代碼或作為一個包),但我似乎無法弄清楚如何正確配置它。 我復制了依賴的cookbook(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()報告它使用PHP 5.3.2,但命令行( php -v )正確報告5.3.9。

我究竟做錯了什么?

/etc/apache2/mods-enabled/php5.load你可以確定Apache將使用哪個版本的php(必須安裝它)。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM