class php {
include apache
$packagelist = ["php5", "php5-common", "php5-cli", "libapache2-mod-php5",
"php5-pgsql", "php5-mysql",
"php5-curl", "php5-suhosin",
"php5-snmp", "php5-xsl"]
package { $packagelist:
ensure => "installed",
}
apache::module { "php5": }
file { "/etc/php5/conf.d/10-pgsql.ini":
ensure => "present",
content => "extension=pgsql.so",
notify => Exec["apache-force-reload"],
require => Package["php5-pgsql"],
}
file { "/etc/php5/conf.d/pgsql.ini":
ensure => "absent",
notify => Exec["apache-force-reload"],
require => Package["php5"],
}
}
...
define php::config (
$path = "/etc/php5/apache/php.ini",
$max_execution_time = "30",
$max_input_time = "60",
$memory_limit = "40M",
$display_errors = "Off",
$post_max_size = "8M",
$upload_max_filesize = "4M",
) {
file { "/etc/php5/apache/php.ini":
ensure => "present",
content => template("php/php.ini.erb"),
require => Package["php5"],
}
}