在Ubuntu 10.04上使用Puppet安装PHP 5.2

我正在使用Puppet(使用Puppet和Drush安装Drupal的目标)在Ubuntu上安装PHP 5.2,但是它安装的软件包都是PHP 5.3。 我find了手动安装PHP 5.2的说明:

http://2bits.com/drupal-planet/various-ways-running-php-52-ubuntu-1004-lucid-lynx.html (方法3)

但是这不符合Puppet的模型。 有没有人find一个更好的方法来安装PHP 5.2(用于Drupal 6)与Puppet?

package { "drupal6": ensure => present } 

就像Drupal 6已经在Ubuntu10.1中一样。 这比自己从源代码安装PHP更好。 我猜测他们已经在PHP 5.3上用Drupal 6修补了一些小问题。

从看依赖关系,我会决定是否我想要mysql或postgresql,并做一个:

 package { "php5-mysql": ensure => present; "mysql-client": ensure => present; "drupal6": ensure => present, require => [ Package["php5-mysql"], Package["mysql-client"] ]; } 

要么:

 package { "php5-pgsql": ensure => present; "postgresql-client": ensure => present; "drupal6": ensure => present, require => [ Package["php5-pgsql"], Package["postgresql-client"] ]; } 

否则,“或”依赖可能会导致错误的数据库库的东西。 当然,你也可能需要适当的数据库服务器的东西,额外的php5组件和各种drupal模块。

PHP 5.2.14安装

 class php { $php = "installed" $phpoptions = "'--with-apxs2=/usr/local/apache2/bin/apxs' '--prefix=/usr/local/php' '--with-curl' '--enable-exif' '--enable-ftp' '--with-gd' '--with-jpeg-dir=/usr/lib' '--with-png-dir=/usr/lib' '--with-xpm-dir=/usr/lib' '--with-gettext' '--with-iconv' '--with-mysql=/usr/lib' '--with-openssl' '--with-pear' '--with-ttf' '--with-freetype-dir=/usr/lib' '--enable-gd-native-ttf' '--with-xmlrpc' '--with-zlib' '--enable-maintainer-zts' '--enable-mbstring' '--enable-sockets' '--enable-pcntl'" $packagelist = [ "libjpeg-dev", "libcurl4-gnutls-dev", "libfreetype6-dev", "libxpm-dev", "libpng12-dev" ] package { $packagelist: ensure => present } exec { "php-install": cwd => "/home/chris/downloads", user => "root", path => "/bin:/usr/bin", command => "/usr/bin/wget http://museum.php.net/php5/php-5.2.14.tar.gz && /bin/tar -xzvf php-5.2.14.tar.gz && cd php-5.2.14 && ./configure $phpoptions && make && make install && touch /tmp/php.txt", creates => "/tmp/php.txt" } }