For snap installation of Nextcloud, run the following commands:
snap set nextcloud php.post-max-size="16G"
snap set nextcloud php.upload-max-filesize="16G"
snap set nextcloud php.max-input-time=3600
snap set nextcloud php.max-execution-time=3600
For non-snap installation of Nextcloud, set the following parameters inside the corresponding php.ini file:
php_value post_max_size="16G"
php_value upload_max_filesize="16G"
php_value max_input_time=3600
php_value max_execution_time=3600