Puppet Class: php

Defined in:
puppet/modules/php/manifests/init.pp

Overview

Class: php

This module configures the PHP scripting language and some of its popular extensions. PHP is the primary language in which MediaWiki is implemented.



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
# File 'puppet/modules/php/manifests/init.pp', line 7

class php {
    include ::apache
    include ::apache::mod::php

    include ::php::remote_debug
    include ::php::composer
    include ::php::xhprof
    include ::php::repository
    include ::php::package

    file { '/etc/php/7.4/mods-available':
        ensure  => directory,
        owner   => 'root',
        group   => 'root',
        mode    => '0755',
        recurse => true,
        purge   => true,
        ignore  => '[^_]*',  # puppet-managed files start w/an underscore
        notify  => Exec['prune_php_ini_files'],
        require => Package['php7.4'],
    }

    exec { 'prune_php_ini_files':
        command => '/bin/true',
        unless  => template('php/prune_php_ini_files.bash.erb'),
    }

    php::ini { 'debug_output':
        settings => {
            display_errors         => true,
            display_startup_errors => true,
            error_reporting        => -1,
        }
    }

    php::ini { 'date_timezone':
        settings => { 'date.timezone' => 'UTC' },
    }

    php::ini { 'session_defaults':
        settings => { 'session.save_path' => '/tmp' },
    }

    php::ini { 'opcache_validate_timestamps':
        settings => {
            'opcache.validate_timestamps' => 'on',
        },
        require  => Package['php7.4-apcu']
    }

    php::ini { 'opcache_revalidate_freq':
        settings => {
            'opcache.revalidate_freq' => 0,
        },
        require  => Package['php7.4-apcu'],
    }
}