413 comes from the web server, not from your code. The request was cut off before PHP was reached, which is why nothing appears in the application log and why raising upload_max_filesize on its own changes nothing.
Nginx
# in http, server or location
client_max_body_size 64M;
sudo nginx -t && sudo systemctl reload nginx
The default is 1M. That is the limit almost everyone hits first.
PHP, both of them
; php.ini
upload_max_filesize = 64M
post_max_size = 68M ; must exceed upload_max_filesize
memory_limit = 128M
max_execution_time = 300
post_max_size must be LARGER than upload_max_filesize, because the request carries the file plus the rest of the form. Set them equal and a file at exactly the limit fails with no useful message at all.
Apache and LiteSpeed
# .htaccess
LimitRequestBody 67108864
php_value upload_max_filesize 64M
php_value post_max_size 68M
Then confirm what is actually loaded
php -i | grep -E 'upload_max_filesize|post_max_size' # the CLI, which may differ
# and from the web, in a temporary file:
# <?php echo ini_get('upload_max_filesize');
The CLI and the web server read different ini files. A change that shows up in php -i and not in the browser means you edited the wrong one - check the PHP-FPM pool directory as well.
Reload after every change
sudo systemctl reload php8.3-fpm nginx
On EGPHP hosting these limits are set per plan and can be raised from the panel. See also an upload limit that ignores your php.ini.