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 Windows server update services
  • ¥15 关于#c语言#的问题:我现在在做一个墨水屏设计,2.9英寸的小屏怎么换4.2英寸大屏
  • ¥15 模糊pid与pid仿真结果几乎一样
  • ¥15 java的GUI的运用
  • ¥15 Web.config连不上数据库
  • ¥15 我想付费需要AKM公司DSP开发资料及相关开发。
  • ¥15 怎么配置广告联盟瀑布流
  • ¥15 Rstudio 保存代码闪退
  • ¥20 win系统的PYQT程序生成的数据如何放入云服务器阿里云window版?
  • ¥50 invest生境质量模块