Merge pull request #189 from marek-knappe/issue-184-php-error-to-stderr

Added option to send logs to docker logs Issue #184
This commit is contained in:
Ric Harvey
2017-11-16 11:55:10 +00:00
committed by GitHub
2 changed files with 7 additions and 0 deletions

View File

@@ -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_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_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_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 | | DOMAIN | Set domain name for Lets Encrypt scripts |
| REAL_IP_HEADER | set to 1 to enable real ip support in the logs | | 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 | | REAL_IP_FROM | set to your CIDR block for real ip in logs |

View File

@@ -117,6 +117,12 @@ if [ -f /etc/nginx/sites-available/default-ssl.conf ]; then
fi fi
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 # Increase the memory_limit
if [ ! -z "$PHP_MEM_LIMIT" ]; then 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 sed -i "s/memory_limit = 128M/memory_limit = ${PHP_MEM_LIMIT}M/g" /usr/local/etc/php/conf.d/docker-vars.ini