Bug #76438 [NoF->ReO]: wrong curl_getinfo time values
| From: | requinix@php.net | Date: | Wed, 08 May 2019 16:54:50 +0000 |
| Subject: | Bug #76438 [NoF->ReO]: wrong curl_getinfo time values | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-220782@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=76438&edit=1
ID: 76438
Updated by: requinix@php.net
Reported by: example1 at example2 dot com
Summary: wrong curl_getinfo time values
-Status: No Feedback
+Status: Re-Opened
Type: Bug
Package: cURL related
Operating System: Windows 7.1
PHP Version: Irrelevant
Block user comment: N
Private report: N
Previous Comments:
------------------------------------------------------------------------
[2019-05-08 15:56:13] ax2002 at gmx dot net
Hi there,
I would like to reopen this bug because I had the same problem. And tried to find out more details
about it.
I have a XAMPP installation in Windows 10.
Apache httpd: 2.4.37 Win32
PHP-version: 7.3.0
Curl-lib: 7.57.0
If I use PHP as module mod_php the curl_getinfo($curl) shows the correct time in
"total_time".
If I use Php as *fcgi* the "total_time" looks like the time in ms x 1000. Other time
values (i.e. starttransfer_time) shaow the same behaviour.
Example:
If the time should be something like 16 ms then "total_time" contains
- 0.016 with mod_php (what is correct)
- 16000 in fcgi (factor 1000)
For the test I use the same install directory with the same binaries of Apache, PHP and its modules.
I only switched the kind of php usage by config (httpd.conf).
The problem seems to be the fcgi mode. Maybe on MS Windows only (I did not tested it on another
platform).
Regards,
Axel
------------------------------------------------------------------------
[2019-04-07 04:22:05] php-bugs at lists dot php dot net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Re-Opened". Thank you.
------------------------------------------------------------------------
[2019-03-26 14:52:33] mike@php.net
Thank you for taking the time to report a problem with PHP.
Unfortunately you are not using a current version of PHP --
the problem might already be fixed. Please download a new
PHP version from http://www.php.net/downloads.php
If you are able to reproduce the bug with one of the latest
versions of PHP, please change the PHP version on this bug report
to the version you tested and change the status back to "Open".
Again, thank you for your continued support of PHP.
------------------------------------------------------------------------
[2018-06-09 20:31:43] example1 at example2 dot com
Description:
------------
curl_getinfo sometimes returns very big time values.
4295.139296, 4295.310296 and 4295.295296 are very frequent (about 57%).
All I have spotted were of format 4295.***296 .
Apache/2.4.27 (Win64) PHP/7.1.9.
Test script:
---------------
<?php
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, 'http://example.com');
curl_setopt($curl, CURLOPT_CONNECTTIMEOUT, 10);
curl_setopt($curl, CURLOPT_TIMEOUT, 15);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_exec($curl);
$info = curl_getinfo($curl);
echo 'total_time = ' . $info['total_time'] . '<br>';
echo 'namelookup_time = ' . $info['namelookup_time'] . '<br>';
echo 'connect_time = ' . $info['connect_time'] . '<br>';
echo 'pretransfer_time = ' . $info['pretransfer_time'] .
'<br>';
echo 'starttransfer_time = ' . $info['starttransfer_time'] .
'<br>';
echo 'redirect_time = ' . $info['redirect_time'] . '<br>';
curl_close($curl);
?>
Expected result:
----------------
typical normal result:
total_time = 0.327
namelookup_time = 1.0E-6
connect_time = 0.171
pretransfer_time = 0.171
starttransfer_time = 0.327
redirect_time = 0
Actual result:
--------------
total_time = 4295.326296
namelookup_time = 0.015
connect_time = 4295.154296
pretransfer_time = 4295.154296
starttransfer_time = 4295.326296
redirect_time = 0
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=76438&edit=1