CodexBloom - Programming Q&A Platform

PHP 8.1: Difficulty Handling Large File Uploads with Symfony 5.4 and NGNIX Configuration

πŸ‘€ Views: 76 πŸ’¬ Answers: 1 πŸ“… Created: 2025-06-06
php symfony nginx PHP

After trying multiple solutions online, I still can't figure this out... I'm currently working with an scenario with file uploads in my Symfony 5.4 application running on PHP 8.1 and NGINX. Specifically, when attempting to upload large files (around 20MB), the upload fails without any clear behavior message. I have increased the `upload_max_filesize` and `post_max_size` in my php.ini to 30MB, but I still receive a 413 Request Entity Too Large behavior from NGINX. Here's part of my NGINX config for handling uploads: ```nginx server { listen 80; server_name myapp.local; client_max_body_size 30M; location / { try_files $uri /index.php$is_args$args; } location ~ \.php$ { include snippets/fastcgi-php.conf; fastcgi_pass unix:/var/run/php/php8.1-fpm.sock; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; } } ``` I've also tried clearing the Symfony cache and checking the logs, but there’s nothing indicating the question's source. Is there something I might have missed in the configuration? Any help would be greatly appreciated! Any ideas what could be causing this?