example42 / puppet-php

A puppet module for php. According to Example42 NextGen spec.
Other
45 stars 62 forks source link

Installing PHP 5.6 #104

Closed aistis- closed 9 years ago

aistis- commented 9 years ago

If I try to install PHP 5.6 I get the following error

==> default: Error: Could not update: Execution of '/usr/bin/apt-get -q -y -o DPkg::Options::=--force-confold --force-yes install php5-fpm=5.6' returned 100: Reading package lists...
==> default: Building dependency tree...
==> default: Reading state information...
==> default: E: Version '5.6' for 'php5-fpm' was not found
==> default: 
==> default: Error: /Stage[main]/Php/Package[php]/ensure: change from 5.5.9+dfsg-1ubuntu4.11 to 5.6 failed: Could not update: Execution of '/usr/bin/apt-get -q -y -o DPkg::Options::=--force-confold --force-yes install php5-fpm=5.6' returned 100: Reading package lists...
==> default: Building dependency tree...
==> default: Reading state information...
==> default: E: Version '5.6' for 'php5-fpm' was not found
==> default:

Config:

class { 'php':
  version             => '5.6',
  package             => "php5-fpm",
  service             => "php5-fpm",
  service_autorestart => false,
  config_file         => "/etc/php5/fpm/php.ini",
  require => [
    Exec['apt-update']
  ]
}
alvagante commented 9 years ago

The version to specify should be exactly the one of the package you want to install, on the underlying distro (and of course you must have a 5.6(.x) php package available, either via default or additional repos.

aistis- commented 9 years ago

The solution:

apt::ppa { 'ppa:ondrej/php5-5.6': }

class { 'php':
  version             => 'latest',
  package             => "php5-fpm",
  service             => "php5-fpm",
  service_autorestart => false,
  config_file         => "/etc/php5/fpm/php.ini",
  require => [
    Apt::Ppa['ppa:ondrej/php5-5.6'],
    Exec['apt-update']
  ]
}
alvagante commented 9 years ago

Thank you for the reference note. I won't add the ppa management in the module, since it's not an official one, afaik, and would be out of scope, somehow. This is the typical stuff that can go to local profile modules.

rgarcia-martin commented 7 years ago

updated:

apt::ppa { 'ppa:ondrej/php': }

class { 'php':
  version             => 'latest',
  package             => "php5.6-fpm",
  service             => "php5.6-fpm",
  service_autorestart => false,
  config_file         => "/etc/php/5.6/fpm/php.ini",
  require => [
    Apt::Ppa['ppa:ondrej/php'],
    Exec['apt-update']
  ]
}