简体   繁体   English

使用Puppet和Vagrant安装特定的PHP版本

[英]Install Specific PHP Version with Puppet & Vagrant

First time puppet user, and I'm having trouble getting an install of a specified version of PHP using Vagrant. 第一次使用木偶的用户,我很难使用Vagrant安装指定版本的PHP。 I'm using the example42/php module, and I keep running into ensure problems. 我正在使用example42 / php模块,并且不断遇到ensure问题。

Error: Could not update: Execution of '/usr/bin/yum -d 0 -e 0 -y install php-5.5.12' returned 1: Error: Nothing to do
Error: /Stage[main]/Php/Package[php]/ensure: change from absent to 5.5.12 failed: Could not update: Execution of '/usr/bin/yum -d 0 -e 0 -y install php-5.5.12' returned 1: Error: Nothing to do
Warning: /Stage[main]/Php/File[php.conf]: Skipping because of failed dependencies

spits out of my console, followed by another attempt that's identical. 从控制台中吐出,然后进行另一次相同的尝试。

My .pp file I'm provisioning with: 我要提供的.pp文件:

class lamp {
    # package {'php':
    #   ensure => present,
    # }
}
node 'node1' {  
    include lamp
    file { '/php':
        ensure => directory,
        # I read that I may need to have a directory in order for the install to work...
    }
    class { 'php':
        version => '5.5.12',
    }
}

As far as I can tell, I'm referencing correctly to the modules, which I store inside /puppet/modules/ and it's finding them, but I'm having a hard time getting a specific version of PHP to install. 据我所知,我正确地引用了模块,这些模块存储在/ puppet / modules /中,并且可以找到它们,但是我很难安装特定版本的PHP。 I could use a very simple "getting started LAMP" for Puppet but that only install 5.3.3 even if I ensure => latest, 我可以为Puppet使用非常简单的“入门LAMP”, 但即使我ensure => latest,也只能安装5.3.3 ensure => latest,

The puppet module only uses your system's package manager (yum) to download specific php packages. puppet模块仅使用系统的软件包管理器(yum)下载特定的php软件包。 If it cannot find the required packages, it will not work. 如果找不到所需的软件包,它将无法正常工作。 5.3.3 is latest version in your repository, so it install that. 5.3.3是您存储库中的最新版本,因此将其安装。 I wouldn't be surprised if this is the only version of php available in your repositories. 如果这是您存储库中可用的唯一php版本,我不会感到惊讶。

You need to configure yum with some repositories which have the required PHP packages and then try the puppet module with that. 您需要使用一些具有必需的PHP软件包的存储库配置yum,然后尝试使用该存储库。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM