#47461 [Opn->Fbk]: file_get_contents()
| From: | jani@php.net | Date: | Fri, 20 Feb 2009 11:56:32 +0000 |
| Subject: | #47461 [Opn->Fbk]: file_get_contents() | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-134044@lists.php.net to get a copy of this message | ||
ID: 47461
Updated by: jani@php.net
Reported By: info at controlzeta dot net
-Status: Open
+Status: Feedback
Bug Type: Performance problem
Operating System: Linux 2.6.9-55.0.9 x86_64
PHP Version: 5.2CVS-2009-02-20 (CVS)
New Comment:
Please try using this CVS snapshot:
http://snaps.php.net/php5.2-latest.tar.gz
For Windows:
http://windows.php.net/snapshots/
Works fine for me.
Previous Comments:
------------------------------------------------------------------------
[2009-02-20 10:45:24] info at controlzeta dot net
Description:
------------
ENGLISH:
The function consumes 100% cpu when external url not answering the
request wiht normally. Example: server busy
SPANISH:
La function file_get_contents('external_url') consume el 100% de cpu
mientras espera la contestación del otro servidor.Ejemplo: servidor
ocupado.
Reproduce code:
---------------
<?php
//ini_set('max_execution_time',500); More time, More CPU 100%
$urlExternal =
"http://www.webservicex.net/CurrencyConvertor.asmx/ConversionRate?FromCurrency=EUR&ToCurrency=USD";
$oneString = file_get_contents($urlExternal);
echo $oneString;
?>
Expected result:
----------------
Get a string of the page request.
Actual result:
--------------
CPU of server 100% usage all the time of the script execution until
waiting the external server aswering.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=47461&edit=1