我需要在使用 puppet 管理的 Red Hat 7.4 服务器上安装 php 5.6 和一些 php 模块。这是我的 init.pp 文件:
package {"epel-release":
provider=>rpm,
ensure=>installed,
install_options => ['--nodeps'],
source=> "https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm",
}
package {"ius-release":
provider=>rpm,
ensure=>installed,
install_options => ['--nodeps'],
source => "https://centos7.iuscommunity.org/ius-release.rpm",
require => Package["epel-release"],
}
$php_packages = ['php56u', 'php56u-devel', 'php56u-intl', 'php56u-ldap', 'php56u-mysqli', 'php56u-xsl', 'php56u-gd', 'php56u-mbstring', 'php56u-mcrypt']
package { $php_packages:
ensure => 'installed',
}
xsl 和 mysqli 安装失败。所有其他包均安装正确。以下是错误:
Error: Execution of '/bin/yum -d 0 -e 0 -y list php56u-xsl' returned 1:
Error: No matching Packages to list
Error: Execution of '/bin/yum -d 0 -e 0 -y list php56u-mysqli' returned 1:
Error: No matching Packages to list
开发环境(Centos 7.3)中的所有软件包均使用以下命令正确安装:
wget https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
sudo rpm -Uvh epel-release-latest-7*.rpm
wget https://centos7.iuscommunity.org/ius-release.rpm
sudo rpm -Uvh ius-release*.rpm
sudo yum install php56u php56u-devel php56u-intl php56u-ldap php56u-mysqli
php56u-xsl php56u-gd php56u-mbstring php56u-mcrypt
我不明白为什么 php56u-xsl 可以在 Centos 上安装,却不能在 Red Hat 上安装,因为我在两个系统上都启用了相同的 rpm。抱歉,文字太多了。直入主题:
rmps 是否包含针对每个操作系统的不同软件包?
有人知道如何在 Red Hat 服务器上安装 php56u-xsl 吗?
答案1
解决方案使用 webtatic 而不是 ius rpms。 https://webtatic.com/packages/php56/提供了软件包列表以及它们提供的软件包。php56w-xml 提供了 php-xsl,这是我的主要问题。以下是更新的 puppet 文件:
package {"epel-release":
provider=>rpm,
ensure=>installed,
install_options => ['--nodeps'],
source=> "https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm",
}
package {"webtatic-release":
provider=>rpm,
ensure=>installed,
install_options => ['--nodeps'],
source => "https://mirror.webtatic.com/yum/el7/webtatic-release.rpm",
require => Package["epel-release"],
}
$php_packages = ['php56w', 'php56w-devel', 'php56w-intl', 'php56w-ldap', 'php56w-mysql', 'php56w-xml', 'php56w-gd', 'php56w-mbstring', 'php56w-common']
package { $php_packages:
ensure => 'installed',
require => Package['webtatic-release']
}