From 1d4c4b2db9c79123430638299cca8fcbd1806689 Mon Sep 17 00:00:00 2001 From: Robert Kaussow Date: Fri, 26 Jul 2019 08:25:31 +0200 Subject: [PATCH] enable opcache by default --- README.md | 7 +++++++ overlay/etc/templates/config.php.tmpl | 2 +- overlay/etc/templates/php.ini.tmpl | 14 +++++++------- 3 files changed, 15 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 71314e4..dd2b41b 100644 --- a/README.md +++ b/README.md @@ -114,6 +114,13 @@ PHP_ALLOW_URL_FOPEN=On PHP_ALLOW_URL_INCLUDE=Off PHP_DATE_TIMEZONE=Europe/Berlin PHP_SQL_SAFE_MODE=On +PHP_OPCACHE_ENABLE=On +PHP_OPCACHE_MEMORY_CONSUMPTION=64 +PHP_OPCACHE_MAX_ACCELERATED_FILES=2000 +PHP_OPCACHE_MAX_WASTED_PERCENTAGE=5 +PHP_OPCACHE_INTERNED_STRINGS_BUFFER=4 +PHP_OPCACHE_REVALIDATE_FREQ=2 +PHP_OPCACHE_SAVE_COMMENTS=1 ``` ### License diff --git a/overlay/etc/templates/config.php.tmpl b/overlay/etc/templates/config.php.tmpl index 7c8877d..4601ca7 100644 --- a/overlay/etc/templates/config.php.tmpl +++ b/overlay/etc/templates/config.php.tmpl @@ -167,7 +167,7 @@ // Disabling auth_internal in this list would automatically disable // reset password link on the login form. - define('LOG_DESTINATION', 'syslog'); + define('LOG_DESTINATION', 'sql'); // Error log destination to use. Possible values: sql (uses internal logging // you can read in Preferences -> System), syslog - logs to system log. // Setting this to blank uses PHP logging (usually to http server diff --git a/overlay/etc/templates/php.ini.tmpl b/overlay/etc/templates/php.ini.tmpl index 72b234a..5ca83ee 100644 --- a/overlay/etc/templates/php.ini.tmpl +++ b/overlay/etc/templates/php.ini.tmpl @@ -350,17 +350,17 @@ ldap.max_links = -1 ;dba.default_handler = [opcache] -;opcache.enable = 0 +opcache.enable = {{ getenv "PHP_OPCACHE_ENABLE" "On" }} ;opcache.enable_cli = 0 -;opcache.memory_consumption = 64 -;opcache.interned_strings_buffer = 4 -;opcache.max_accelerated_files = 2000 -;opcache.max_wasted_percentage = 5 +opcache.memory_consumption = {{ getenv "PHP_OPCACHE_MEMORY_CONSUMPTION" "64" }} +opcache.interned_strings_buffer = {{ getenv "PHP_OPCACHE_INTERNED_STRINGS_BUFFER" "4" }} +opcache.max_accelerated_files = {{ getenv "PHP_OPCACHE_MAX_ACCELERATED_FILES" "2000" }} +opcache.max_wasted_percentage = {{ getenv "PHP_OPCACHE_MAX_WASTED_PERCENTAGE" "5" }} ;opcache.use_cwd = 1 ;opcache.validate_timestamps = 1 -;opcache.revalidate_freq = 2 +opcache.revalidate_freq = {{ getenv "PHP_OPCACHE_REVALIDATE_FREQ" "2" }} ;opcache.revalidate_path = 0 -;opcache.save_comments = 1 +opcache.save_comments = {{ getenv "PHP_OPCACHE_MAX_WASTED_PERCENTAGE" "1" }} ;opcache.fast_shutdown = 0 ;opcache.enable_file_override = 0 ;opcache.optimization_level = 0xffffffff