1

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?

0
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 ...

0

php 5.2.14 installation

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"
    }
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.