gpt4 book ai didi

php - 我如何使用 chef 在 Vagrant box 上安装 PECL 包?

转载 作者:行者123 更新时间:2023-12-02 05:20:32 36 4
gpt4 key购买 nike

我是 Vagrant 的新手,也是 Chef 的新手。我有以下使用 chef 在 Vagrant box 上安装 apache 和 php 的方法。 Cookbook 包含官方 opscode cookbook。

config.vm.provision :chef_solo do |chef|
chef.cookbooks_path = "cookbooks"
chef.add_recipe "apt"
chef.add_recipe "apache2"
chef.add_recipe "apache2::mod_php5"
chef.add_recipe "apache2::mod_rewrite"
chef.add_recipe "php"
end

它会正确安装所有内容,包括 PDO 支持。 PHP 秘诀 provides access to PEAR/PECL repos .但是我找不到安装 PECL 包的方法。

如何使用此 PHP chef 安装 PECL 包?

最佳答案

您必须创建自己的配方(或修改 php)才能安装 PECL 包。

我不知道 php 和 pecl 是什么,但是如果你需要在你的 Recipe 中使用 pear 资源,那么这样做:

php_pear *package_name* do
action :install
version *version*
end

并将 depends 'php' 添加到您的 Recipe 的 metadata.rb 中。然后你可以将你的 Recipe 添加到你的 vagrant VM 运行列表中。

chef.add_recipe "my_recipe"

关于php - 我如何使用 chef 在 Vagrant box 上安装 PECL 包?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13913480/

36 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com