Comment 0 for bug 1887826

Revision history for this message
Stephen Rees (srees304) wrote :

See https://bugs.php.net/bug.php?id=79013 for this exact issue.

Upgrading Ubuntu's supported PHP version to 7.4.4 *should* fix the issue, or backporting the patch in the link I included.

PHP7.4.3 has an issue with cURL where it is defaulting to chunked mode when transferring a file via POST. Setting the HTTP version does not impact it. For third-party servers that don't support chunked but expect a content-length, there is no way to make it work.

package: php7.4 (7.4.3-4ubuntu2.2)(possibly related, libapache2-mod-php7.4d, php7.4-curl)
release: Ubuntu 20.04 LTS

Expect: PHP-cURL to POST HTTP1.1 multipart/form-data with automatically generated Content-Length and empty Transfer-Encoding headers.
Actual: PHP-cURL POSTS HTTP1.1 multipart/form-data with Transfer-Encoding: chunked and empty Content-Length headers.