php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #79289 POSTing a CurlFile causes timeout
Submitted: 2020-02-20 10:11 UTC Modified: 2020-02-20 12:59 UTC
From: anton dot gardalv at winlas dot se Assigned: cmb (profile)
Status: Duplicate Package: cURL related
PHP Version: 7.4.2 OS: Windows
Private report: No CVE-ID: None
 [2020-02-20 10:11 UTC] anton dot gardalv at winlas dot se
Description:
------------
Hello,
after upgrading some of our environments to PHP 7.4 we've noticed that POSTing a CurlFile via CURLOPT_POSTFIELDS seems to cause a timeout. The test script works fine in PHP 7.3 but times out in 7.4. 

Test script:
---------------
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
  CURLOPT_URL => "http://localhost/testpost.php",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_SSL_VERIFYHOST => 0,
  CURLOPT_SSL_VERIFYPEER => 0,
  CURLOPT_TIMEOUT => 25,
  CURLOPT_FOLLOWLOCATION => false,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => array('file'=> new CURLFILE('C:/test.txt')),
));
$response = curl_exec($curl);
var_dump($response);
curl_close($curl);
?>

TestPost.php
<?php 
var_dump($_POST);
var_dump($_FILES);
?>


Expected result:
----------------
A reply from the TestPost.php script containing information about the file I sent earlier.

Actual result:
--------------
PHP/Curl times out.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2020-02-20 12:41 UTC] cmb@php.net
-Status: Open +Status: Feedback -Assigned To: +Assigned To: cmb
 [2020-02-20 12:41 UTC] cmb@php.net
This is likely a duplicate of bug #79013. Which SAPI is receiving
the upload?  IIS/FCGI?
 [2020-02-20 12:47 UTC] anton dot gardalv at winlas dot se
-Status: Feedback +Status: Assigned
 [2020-02-20 12:47 UTC] anton dot gardalv at winlas dot se
Yes, receiving sapi is running fastcgi in iis
 [2020-02-20 12:53 UTC] cmb@php.net
-Status: Assigned +Status: Duplicate
 [2020-02-20 12:53 UTC] cmb@php.net
Thanks!  Then this is indeed a duplicate of the mentioned bug,
which will be fixed in PHP 7.4.4 one way or another.
 [2020-02-20 12:59 UTC] anton dot gardalv at winlas dot se
Okay, Thanks a lot for your answer :)
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 15:01:29 2024 UTC