diff --git a/docs/config_flags.md b/docs/config_flags.md index 2f6102e8..a8d62efd 100644 --- a/docs/config_flags.md +++ b/docs/config_flags.md @@ -24,6 +24,7 @@ The following flags are a list of all the currently supported options that can b | PHP_MEM_LIMIT | Set higher PHP memory limit, default is 128 Mb | | PHP_POST_MAX_SIZE | Set a larger post_max_size, default is 100 Mb | | PHP_UPLOAD_MAX_FILESIZE | Set a larger upload_max_filesize, default is 100 Mb | +| PHP_ERRORS_STDERR | Send php logs to docker logs | | DOMAIN | Set domain name for Lets Encrypt scripts | | REAL_IP_HEADER | set to 1 to enable real ip support in the logs | | REAL_IP_FROM | set to your CIDR block for real ip in logs | diff --git a/scripts/start.sh b/scripts/start.sh index 83320d1c..d7785c04 100644 --- a/scripts/start.sh +++ b/scripts/start.sh @@ -117,6 +117,12 @@ if [ -f /etc/nginx/sites-available/default-ssl.conf ]; then fi fi +#Display errors in docker logs +if [ ! -z "$PHP_ERRORS_STDERR" ]; then + echo "log_errors = On" >> /usr/local/etc/php/conf.d/docker-vars.ini + echo "error_log = /dev/stderr" >> /usr/local/etc/php/conf.d/docker-vars.ini +fi + # Increase the memory_limit if [ ! -z "$PHP_MEM_LIMIT" ]; then sed -i "s/memory_limit = 128M/memory_limit = ${PHP_MEM_LIMIT}M/g" /usr/local/etc/php/conf.d/docker-vars.ini