From ab69ff394d44545a350a82ef4b1f21d58fa1715a Mon Sep 17 00:00:00 2001 From: Kenio de Souza Date: Mon, 8 Sep 2025 11:51:17 -0300 Subject: [PATCH] =?UTF-8?q?Ajustando=20tamanho=20da=20requisi=C3=A7=C3=A3o?= =?UTF-8?q?=20recebida?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Dockerfile | 34 +++++++++++++++++++++++++++++----- vendor/action/log/log_save.php | 6 +----- 2 files changed, 30 insertions(+), 10 deletions(-) diff --git a/Dockerfile b/Dockerfile index c5d5bd5..1552462 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,14 +5,36 @@ FROM php:8.4-apache RUN apt-get update && apt-get install -y \ libpng-dev \ libjpeg-dev \ - libonig-dev libxml2-dev zip unzip curl git libzip-dev libfreetype6-dev libjpeg62-turbo-dev && docker-php-ext-configure gd --with-freetype --with-jpeg && docker-php-ext-install -j$(nproc) gd mbstring && docker-php-ext-install pdo pdo_mysql mysqli zip && docker-php-ext-enable opcache - + libonig-dev \ + libxml2-dev \ + zip \ + unzip \ + curl \ + git \ + libzip-dev \ + libfreetype6-dev \ + libjpeg62-turbo-dev \ + && docker-php-ext-configure gd --with-freetype --with-jpeg \ + && docker-php-ext-install -j$(nproc) gd mbstring \ + && docker-php-ext-install pdo pdo_mysql mysqli zip \ + && docker-php-ext-enable opcache # Habilita o módulo de reescrita do Apache (útil para Laravel ou outros frameworks) RUN a2enmod rewrite -# Adiciona a diretiva ServerName globalmente -RUN echo "ServerName localhost" >> /etc/apache2/apache2.conf +# Ajusta limites do Apache para aceitar requisições grandes +RUN echo "ServerName localhost" >> /etc/apache2/apache2.conf \ + && echo "LimitRequestBody 0" >> /etc/apache2/apache2.conf \ + && echo "LimitRequestLine 65536" >> /etc/apache2/apache2.conf \ + && echo "LimitRequestFieldSize 65536" >> /etc/apache2/apache2.conf + +# Ajusta limites do PHP (upload e POST maiores) +RUN { \ + echo "upload_max_filesize=200M"; \ + echo "post_max_size=200M"; \ + echo "memory_limit=512M"; \ + echo "max_execution_time=300"; \ +} > /usr/local/etc/php/conf.d/uploads.ini # Substitui a configuração padrão do Apache para permitir .htaccess COPY ./apache/000-default.conf /etc/apache2/sites-available/000-default.conf @@ -25,7 +47,9 @@ RUN mkdir -p /var/www/html/temp \ && mkdir -p /var/www/html/rel # Define permissões apropriadas -RUN chown -R www-data:www-data /var/www/html && find /var/www/html -type d -exec chmod 755 {} + && find /var/www/html -type f -exec chmod 644 {} + +RUN chown -R www-data:www-data /var/www/html \ + && find /var/www/html -type d -exec chmod 755 {} + \ + && find /var/www/html -type f -exec chmod 644 {} + # Define o diretório de trabalho WORKDIR /var/www/html diff --git a/vendor/action/log/log_save.php b/vendor/action/log/log_save.php index 691c192..7220581 100644 --- a/vendor/action/log/log_save.php +++ b/vendor/action/log/log_save.php @@ -239,11 +239,7 @@ try { $size, $path ); - } - - - error_reporting(E_ALL); - ini_set('display_errors', 'On'); + } /** Exclui o registro anterior sobre o banco de dados */ $Database->Delete($clientId);