From 21577d91773401ff3510823d4f3e9c84d03d3776 Mon Sep 17 00:00:00 2001 From: Alexander Sosna Date: Mon, 24 Aug 2020 15:45:08 +0200 Subject: [PATCH] Implement essential php.ini configuration via ENV --- docker-entrypoint.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh index bee572c2..e0a2c8ba 100755 --- a/docker-entrypoint.sh +++ b/docker-entrypoint.sh @@ -43,6 +43,13 @@ file_env() { unset "$fileVar" } +# Get essential PHP_INI configuration +file_env PHP_INI_MEMORY_LIMIT 512M + +# Set essential PHP_INI configuration +# It is important to set essential variables like 'memory-limit' before the first start to premvent OOM during installation and statup. +echo "memory_limit=${PHP_INI_MEMORY_LIMIT}" > /usr/local/etc/php/conf.d/memory-limit.ini; + if expr "$1" : "apache" 1>/dev/null; then if [ -n "${APACHE_DISABLE_REWRITE_IP+x}" ]; then a2disconf remoteip