doumao1047 2014-05-07 12:39
浏览 30
已采纳

如何使用Chef从Apache和Apache安装特定版本的PHP?

I am using Chef's community cookbooks, in particular the apt, php and apache2 cookbooks. My role which is ran on a node:

name "development"

# list of recipes to run
run_list(
    "recipe[apt]",
    "recipe[php::source]",
    "recipe[apache2]",
    "recipe[apache2::mod_php5]",
    "recipe[apache2::mod_rewrite]",
)

# attributes setup
override_attributes(
    "php" => {
        "version" => "5.4.27",
        "checksum" => "3080690bbb14d798a511e325a81a6f32"
    }
)

As you can see, I would like to install PHP 5.4.27 from source. If I run only the php::source, I indeed have PHP 5.4.27. However, when I run the apache2 cookbook as well, the apache2::mod_php5 installs another PHP 5.3 from repository (Ubuntu 12.04 has PHP 5.3 in its repo). I guess the package installs libapache2-mod-php5 which relies on php5 package therefore the PHP is installed again.

I don't want two versions of PHP. I would like to have only one; the PHP 5.4.27. Both for Apache and CLI. Can I somehow instruct apache cookbook to use the PHP 5.4.27?

  • 写回答

2条回答 默认 最新

  • dongying6896 2014-05-07 18:08
    关注

    Not if you use the apache2::mod_php5 recipe.

    If you look into the recipe you can see that it installs the libapache2-mod-php5 package, which brings php5-common as a dependency.

    If you want to avoid pulling in that, you'll have to write your own recipe for the php module, probably compiling the module from source.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 Centos7 / PETGEM
  • ¥15 csmar数据进行spss描述性统计分析
  • ¥15 各位请问平行检验趋势图这样要怎么调整?说标准差差异太大了
  • ¥15 delphi webbrowser组件网页下拉菜单自动选择问题
  • ¥15 wpf界面一直接收PLC给过来的信号,导致UI界面操作起来会卡顿
  • ¥15 init i2c:2 freq:100000[MAIXPY]: find ov2640[MAIXPY]: find ov sensor是main文件哪里有问题吗
  • ¥15 运动想象脑电信号数据集.vhdr
  • ¥15 三因素重复测量数据R语句编写,不存在交互作用
  • ¥15 微信会员卡等级和折扣规则
  • ¥15 微信公众平台自制会员卡可以通过收款码收款码收款进行自动积分吗