diff modules/website/manifests/php.pp @ 454:d0e7979c7e8c

Update PHP configs for Ubuntu Mostly fixing some INI naming so that it is consistent between packages and what we write (so we don't end up with mixed/duplicate content)
author IBBoard <dev@ibboard.co.uk>
date Sun, 13 Aug 2023 15:26:37 +0100
parents 83fbddb56de1
children 2f2ecf1f0215
line wrap: on
line diff
--- a/modules/website/manifests/php.pp	Sun Aug 13 15:25:01 2023 +0100
+++ b/modules/website/manifests/php.pp	Sun Aug 13 15:26:37 2023 +0100
@@ -12,6 +12,17 @@
     $pcre_jit = 1
   }
 
+  if $operatingsystem == 'CentOS' {
+    $ini_prefix_10 = '10-'
+    $ini_prefix_20 = '20-'
+  }
+  elsif $operatingsystem == 'Ubuntu' {
+    # Ubuntu doesn't prefix its ini files as created here
+    # and has a different way of handling ordering
+    $ini_prefix_10 = ''
+    $ini_prefix_20 = ''
+  }
+
   file { '/run/php/':
     ensure => directory,
   } ->
@@ -52,33 +63,35 @@
     },
     extensions => {
       ctype => {
-        ini_prefix => '20-',
+        ini_prefix => $ini_prefix_20,
       },
       gd => {
-        ini_prefix => '20-',
+        ini_prefix => $ini_prefix_20,
       },
       iconv => {
-        ini_prefix => '20-',
+        ini_prefix => $ini_prefix_20,
       },
       mbstring => {
-        ini_prefix => '20-',
+        ini_prefix => $ini_prefix_20,
       },
       opcache => {
         ensure => present,
-        ini_prefix => '10-',
+        ini_prefix => $ini_prefix_10,
         zend => true,
         settings => {
           'opcache.enable' => 1,
           'opcache.enable_cli' => 1,
-          'opcache.interned_strings_buffer' => 16,
-          'opcache.max_accelerated_files' => 10000,
-          'opcache.memory_consumption' => 128,
+          'opcache.interned_strings_buffer' => 32,
+          'opcache.max_accelerated_files' => 15000,
+          'opcache.max_wasted_percentage' => 3,
+          'opcache.memory_consumption' => 256,
           'opcache.save_comments' => 1,
           'opcache.revalidate_freq' => 60,
+          'opcache.huge_code_pages' => 0,
         }
       },
       xml => {
-        ini_prefix => '20-',
+        ini_prefix => $ini_prefix_20,
       },
     } + $extras,
   }