28
|
1 |
class sysconfig::php ( |
|
2 |
) inherits sysconfig::params { |
|
3 |
|
|
4 |
$php_packages = [ |
|
5 |
'php56', |
|
6 |
'php56-php', |
|
7 |
'php56-php-common', |
|
8 |
'php56-php-mbstring', |
|
9 |
'php56-php-mcrypt', |
|
10 |
'php56-php-pdo', |
|
11 |
'php56-php-pecl-memcache', |
|
12 |
'php56-php-gd', |
|
13 |
'php56-php-mysqlnd', |
|
14 |
'php56-php-pecl-imagick' |
|
15 |
] |
|
16 |
|
|
17 |
package { $php_packages: |
|
18 |
ensure => present, |
|
19 |
require => Package["httpd"] |
|
20 |
} |
|
21 |
|
|
22 |
file { '/var/log/php': |
|
23 |
ensure => directory, |
|
24 |
owner => 'apache', |
30
|
25 |
group => 'apache', |
|
26 |
require => Package["httpd"] |
28
|
27 |
} |
|
28 |
|
|
29 |
augeas { "php_ini/memory_limit": |
|
30 |
lens => "PHP.lns", |
|
31 |
incl => "/opt/remi/php56/root/etc/php.ini", |
325
|
32 |
changes => "set PHP/memory_limit 512M", |
28
|
33 |
notify => Service['httpd'], |
|
34 |
require => Package["php56"] |
|
35 |
}-> |
|
36 |
augeas { "php_ini/max_execution_time": |
|
37 |
lens => "PHP.lns", |
|
38 |
incl => "/opt/remi/php56/root/etc/php.ini", |
|
39 |
changes => "set PHP/max_execution_time 50", |
|
40 |
notify => Service['httpd'], |
|
41 |
require => Package["php56"] |
|
42 |
}-> |
|
43 |
augeas { "php_ini/upload_max_filesize": |
|
44 |
lens => "PHP.lns", |
|
45 |
incl => "/opt/remi/php56/root/etc/php.ini", |
|
46 |
changes => "set PHP/upload_max_filesize 50M", |
|
47 |
notify => Service['httpd'], |
|
48 |
require => Package["php56"] |
|
49 |
}-> |
|
50 |
augeas { "php_ini/error_log": |
|
51 |
lens => "PHP.lns", |
|
52 |
incl => "/opt/remi/php56/root/etc/php.ini", |
|
53 |
changes => "set PHP/error_log /var/log/php/php_errors.log", |
|
54 |
notify => Service['httpd'], |
|
55 |
require => [Package["php56"], File['/var/log/php']] |
|
56 |
} |
|
57 |
#TODO : set php log |
|
58 |
file { "/var/www/html/phpinfo.php": |
|
59 |
mode => 440, |
|
60 |
owner => 'apache', |
|
61 |
group => 'apache', |
30
|
62 |
source => "puppet:///modules/sysconfig/phpinfo.php", |
|
63 |
require => Package["httpd"] |
28
|
64 |
} |
|
65 |
|
|
66 |
} |