php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #47461 file_get_contents()
Submitted: 2009-02-20 10:45 UTC Modified: 2009-02-28 01:00 UTC
Votes:7
Avg. Score:4.1 ± 0.8
Reproduced:7 of 7 (100.0%)
Same Version:1 (14.3%)
Same OS:3 (42.9%)
From: info at controlzeta dot net Assigned:
Status: No Feedback Package: Performance problem
PHP Version: 5.2CVS-2009-02-20 (CVS) OS: Linux 2.6.9-55.0.9 x86_64
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2009-02-20 10:45 UTC] 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.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-02-20 11:56 UTC] jani@php.net
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.
 [2009-02-28 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Wed Mar 27 00:01:27 2019 UTC