Bug #79289 [NEW]: POSTing a CurlFile causes timeout
| From: | anton dot gardalv at winlas dot se | Date: | Thu, 20 Feb 2020 10:11:11 +0000 |
| Subject: | Bug #79289 [NEW]: POSTing a CurlFile causes timeout | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-225643@lists.php.net to get a copy of this message | ||
From: anton dot gardalv at winlas dot se
Operating system: Windows
PHP version: 7.4.2
Package: cURL related
Bug Type: Bug
Bug description:POSTing a CurlFile causes timeout
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.
--
Edit bug report at https://bugs.php.net/bug.php?id=79289&edit=1
--
Fix committed: https://bugs.php.net/fix.php?id=79289&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=79289&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=79289&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=79289&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=79289&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=79289&r=support
Expected behavior: https://bugs.php.net/fix.php?id=79289&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=79289&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=79289&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=79289&r=globals
PHP version support discontinued: https://bugs.php.net/fix.php?id=79289&r=phptooold
Daylight Savings: https://bugs.php.net/fix.php?id=79289&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=79289&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=79289&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=79289&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=79289&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=79289&r=mysqlcfg