doumao1047 2014-05-07 04: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 10: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 VAE代码如何画混淆矩阵
  • ¥15 求遗传算法GAMS代码
  • ¥15 雄安新区高光谱数据集的下载网址打不开
  • ¥66 android运行时native和graphics内存详细信息获取
  • ¥100 求一个c#通过CH341读取数据的Demo,能够读取指定地址值的功能
  • ¥15 rk3566 Android11 USB摄像头 微信
  • ¥15 torch框架下的强化学习DQN训练奖励值浮动过低,希望指导如何调整
  • ¥35 西门子博图v16安装密钥提示CryptAcquireContext MS_DEF_PROV Error of containger opening
  • ¥15 mes系统扫码追溯功能
  • ¥40 selenium访问信用中国
手机看
程序员都在用的中文IT技术交流社区

程序员都在用的中文IT技术交流社区

专业的中文 IT 技术社区,与千万技术人共成长

专业的中文 IT 技术社区,与千万技术人共成长

关注【CSDN】视频号,行业资讯、技术分享精彩不断,直播好礼送不停!

关注【CSDN】视频号,行业资讯、技术分享精彩不断,直播好礼送不停!

客服 返回
顶部