Using Puppet to Install PHP 5.2 on Ubuntu 10.04

drupalphp5puppetubuntu-10.04

I'm working on installing PHP 5.2 on Ubuntu using Puppet (with the goal of using Puppet and Drush to install Drupal), but the packages it installs are all PHP 5.3. I found instructions to install PHP 5.2 manually:

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

But this doesn't follow Puppet's model. Has anyone found a better way to install PHP 5.2 (For use with Drupal 6) with Puppet?

Best Answer

package { "drupal6": ensure => present }

Looks like Drupal 6 is in universe for Ubuntu 10 already. That's better than installing PHP from source yourself. I'm guessing they already patched around the minor issues with Drupal 6 on PHP 5.3.

From looking at the dependencies, I'd decide if I wanted mysql or postgresql and do one of:

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

Or:

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

Otherwise the "or" dependencies could pull in the wrong database library stuff. You may also want the appropriate database server stuff, additional php5 components and various drupal modules, of course ...

Related Topic